Installing the Perl Module

I am trying to install a Perl module called: File-Copy-Recursive, and I am doing the following steps:

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

and I get the message "It seems that you do not have a C compiler and no utility is installed. Trying to install dmake and the MinGW gcc compiler using the Perl package manager. This may take several minutes ..."

"Downloading package package repository package ActiveState package ... failed 500 Cannot connect to ppm4.activestate.com:80 (connect: timeout). Download file-Copy-Recursive packlist ... not found ppm.bat install failed: cannot be found MinGW package "

This failed because I am behind the proxy server and I know the proxy server settings, but I do not know how to apply them in this situation.

Does anyone know of any alternative fixes for this solution?

Thanks.

+4
source share
3 answers

You seem to be using ActiveState Perl, which comes with its own package manager (called PPM) to ease the pain of installing modules, especially those that usually require the C compiler to install.

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

 C:\>set http_proxy=http://username: password@proxy.example.org :8080 

Then in the same command prompt window try this (this works for me, although I am not behind a proxy server):

 C:\>ppm install File-Copy-Recursive 

Note that this is probably a good idea (perhaps even required?) To run cmd.exe "As an Administrator" to make sure that it has full authorization.

EDIT:. The special module you want to use is written in pure Perl. For a quick β€œinstall”, you can simply download it from CPAN, extract the files and copy the β€œRecursive.pm” file to the File \ Copy directory structure located in the same directory as your script:

 yourscript.pl File\ Copy\ Recursive.pm 
+13
source

Alternatively, you can try the Strawberry Perl distribution , which has tools for creating XS modules.

+5
source

Hi. I think you are using Activestate Perl.

see http://docs.activestate.com/activeperl/5.10/faq/ActivePerl-faq2.html#what_is_ppm

PPM is installed automatically using ActivePerl.

To use PPM, your computer must be connected to the Internet, have access to the PPM repository on a local hard drive or network resource, or have access to the installed ActiveState ActiveDVD.

If you connect to the Internet through a firewall or proxy server, you may need to set the http_proxy environment variable. For more information, see PPM, Proxies, and Firewalls.

+1
source

Source: https://habr.com/ru/post/1332246/


All Articles