Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl Module Installation

I am attempting to install a Perl Module entitled: File-Copy-Recursive and I am following these steps:

1) open cmd.exe 2) perl -MCPAN -e 'install File::Copy::Recursive;'

and I receive the message "It looks like you don't have a C compiler and make utility installed. Trying to install dmake and the MinGW gcc compiler using the Perl Package Manager. This may take a few minutes..."

"Downloading ActiveState Package Repository packlist...failed 500 Can't connect to ppm4.activestate.com:80 (connect: timeout). Downloading File-Copy-Recursive packlist...not found ppm.bat install failed: Can't find any package that provides MinGW"

These failed because I am behind a proxy, and I do know the proxy settings but I don't know how to apply them in this situation.

Is anyone aware of any alternative fixes to this solution?

Thank you.

like image 676
Christopher Peterson Avatar asked Dec 15 '10 17:12

Christopher Peterson


People also ask

Where do I install Perl modules?

Installing Additional Modules Now that you have CPAN configured, you can install all the modules you want either from CPAN's interactive shell ( perl -MCPAN -e shell ) or from the command line ( perl -MCPAN -e 'install FOO::BAR' ). The modules will be installed into your ~/perl5lib/lib directory.

How do I install CPAN modules?

To install Perl modules using CPAN, you need to use the cpan command-line utility. You can either run cpan with arguments from the command-line interface, for example, to install a module (e.g Geo::IP) use the -i flag as shown.


1 Answers

It seems you are using ActiveState Perl, which comes with its own package manager (called PPM) to ease the pain of installing modules, especially those which would normally require a C compiler to be able to install.

Try following the instructions to set up your environment so that PPM knows about your proxy. For example, to set the proxy settings for a single instance of cmd.exe:

C:\>set http_proxy=http://username:[email protected]:8080

Then, in the same command prompt window, try this (it works for me, though I'm not behind a proxy):

C:\>ppm install File-Copy-Recursive

Note that it's probably a good idea (maybe even required?) to run cmd.exe "As Administrator" to make sure it has full authorization.

EDIT: The particular module you want to use is written in pure Perl. For a quick "installation", you can just download it from CPAN, extract the files, and copy the "Recursive.pm" file into a File\Copy directory structure placed in the same directory as your script:

yourscript.pl
File\
    Copy\
        Recursive.pm
like image 200
Cameron Avatar answered Oct 01 '22 01:10

Cameron