From the debug output it looks like the script is connecting using passive mode - you can see this from the line
Net::FTP=GLOB(0x9da13a0)>>> PASV
... it then times out for some reason - presumably because it is not receiving any data from ftp.cpan.org (maybe this is being firewalled out.
(more info on passive/active FTP here: http://slacksite.com/other/ftp.html)

... which is strange since when I run the same script it does not enter passive mode...
Net::FTP>>> Net::FTP(2.77) Net::FTP>>> Exporter(5.58) Net::FTP>>> Net::Cmd(2.28) Net::FTP>>> IO::Socket::INET(1.31) Net::FTP>>> IO::Socket(1.30) Net::FTP>>> IO::Handle(1.27) Net::FTP=GLOB(0x22d19c)<<< 220 Welcome to the ftp.linux.hr FTP service +. Net::FTP=GLOB(0x22d19c)>>> USER anonymous Net::FTP=GLOB(0x22d19c)<<< 331 Please specify the password. Net::FTP=GLOB(0x22d19c)>>> PASS .... Net::FTP=GLOB(0x22d19c)<<< 230- Net::FTP=GLOB(0x22d19c)<<< 230-Ovo je ftp.linux.hr, FTP posluzitelj Hr +vatske Udruge Linux Korisnika. Net::FTP=GLOB(0x22d19c)<<< 230- Net::FTP=GLOB(0x22d19c)<<< 230-Pogledajte README datoteku za opis sadr +zaja na nasem posluzitelju. Net::FTP=GLOB(0x22d19c)<<< 230- Net::FTP=GLOB(0x22d19c)<<< 230-CD ISO imagei su na iso.linux.hr! Net::FTP=GLOB(0x22d19c)<<< 230- Net::FTP=GLOB(0x22d19c)<<< 230- -- ftpadmin@linux.hr Net::FTP=GLOB(0x22d19c)<<< 230 Login successful. Net::FTP=GLOB(0x22d19c)>>> CWD /pub/CPAN Net::FTP=GLOB(0x22d19c)<<< 250-The Comprehensive Perl Archive Network +(http://www.cpan.org/) Net::FTP=GLOB(0x22d19c)<<< 250-master site has been from the very begi +nning (1995) hosted at FUNET, Net::FTP=GLOB(0x22d19c)<<< 250-the Finnish University NETwork. Net::FTP=GLOB(0x22d19c)<<< 250- Net::FTP=GLOB(0x22d19c)<<< 250- Net::FTP=GLOB(0x22d19c)<<< 250 Directory successfully changed. Net::FTP=GLOB(0x22d19c)>>> PORT 164,48,254,74,158,171 Net::FTP=GLOB(0x22d19c)<<< 200 PORT command successful. Consider using + PASV. Net::FTP=GLOB(0x22d19c)>>> RETR README.html Net::FTP=GLOB(0x22d19c)<<< 150 Opening BINARY mode data connection for + README.html (5804 bytes). Net::FTP=GLOB(0x22d19c)<<< 226 File send OK.
Maybe you can try active mode and see if that works. You can do this using the following line:
my $ftp=Net::FTP->new("ftp.cpan.org", Debug => 1, Passive => 0)
Hope that helps.

In reply to Re^3: Problem with Net::FTP by rpanman
in thread Problem with Net::FTP by cool

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.