Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

koschei (147)

koschei
  useperl@dellah.org
http://eh.org/~koschei/

Um. Me. Iain Truskett. Can be found as either Spoon or Koschei around the place, and as Braxiatel in rare circumstances. Um. Cool. Ta.

My perl svn repository [dellah.org] if you want bits of code by me. Also see dellah.org [dellah.org] for most of them in action.

My friends [perl.org], foes [perl.org], fans [perl.org], and freaks [perl.org]. And you can see what my friends are journalling [perl.org].

And everybody's journals [perl.org] (in order of updating).

Journal of koschei (147)

Wednesday October 08, 2003
11:10 PM

Solving CPAN ftp proxy problems in perl

[ #15129 ]

With perl 5.8 having libnet as standard and the generally appalling state of firewalls and default configurations, it can be irritating when CPAN spends 5 minutes trying Net::FTP when if it had tried, say, wget it would have been over quickly.

Quick solution:

'dontload_hash' => { 'Net::FTP' => 1 },

in your CPAN/Config.pm (or wherever you keep your config)

The docs don't elaborate on it much so I guess I'll have to submit a patch to the firewall section.

  dontload_hash      anonymous hash: modules in the keys will not be
                     loaded by the CPAN::has_inst() routine

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I've been feeling like an idiot behind my firewall for a while. Thanks for posting!
  • The reason why wget works for you and Net::FTP doesn't is that wget uses passive FTP. If you set the FTP_PASSIVE environment value to a true value, Net::FTP will use passive FTP.
    --

    --
    "Cake or Death!" .... "Cake please"
    • Heh. Close. Actually, there are circumstances where FTP needs to be proxied and Net::FTP doesn't (cannot) understand a http based proxy. In this case, wget, lynx, ncftp etc. work perfectly happily. But because we haven't downloaded LWP into our fresh install we don't have something in perl that understands an http proxy. That won't stop Net::FTP from trying and eventually timing out and having the others tried.
      --
        ---ict / Spoon
      • Net::FTP SUCKS BIG! export FTP_PASSIVE=1 doesnt works in debian. Do yourself a favour: locate -i net | grep -i ftp | grep perl them rm -r all of it and use wget!!!