gwhite has asked for the wisdom of the Perl Monks concerning the following question:

A client is trying to load modules with CPAN behind a firewall. FTP is blocked, and I had him add an http address to the urllist and that also did not work. The documentation for CPAN says:

To access servers outside these types of firewalls with perl (even for ftp) you will need to use LWP.

How does one do that within the CPAN shell?

Thanks

g_White

Replies are listed 'Best First'.
Re: CPAN help
by clemburg (Curate) on Aug 09, 2001 at 17:52 UTC

    This is not an issue of how to use the CPAN shell, but which modules come preinstalled at your site.

    The usual solution for using CPAN behind firewalls is:

    • have LWP modules preinstalled (e.g., from a CPAN CD or Linux distribution CD)
    • set the http_proxy and ftp_proxy environment variables to something like "http://proxy.mydomain.com:8080"
    • just use the CPAN shell like before

    Christian Lemburg
    Brainbench MVP for Perl
    http://www.brainbench.com

Re: CPAN help
by trantor (Chaplain) on Aug 09, 2001 at 17:58 UTC

    Check the configuration section in the CPAN module documentation (perldoc CPAN).

    There's also a section regarding CPAN and firewalls.

    In a nutshell, you can define your own $HOME/.cpan/CPAN/MyConfig.pm where you can specify a proxy for your HTTP requests.

    You should also be able to set the http_proxy environment variable to instruct CPAN to use it. Moreover, many HTTP proxies also act as FTP proxies, so you might want to try with ftp_proxy too.

    Anyway, check the documentation and you'll find many ways (there's more than one way to do it, even when configuring) to access CPAN behind a firewall.

    Happy {perl -MCPAN -eshell}ing!

    -- TMTOWTDI