in reply to Re^2: Problem with Net::FTP
in thread Problem with Net::FTP

Net::FTP=GLOB(0x9da13a0)<<< 220 (vsFTPd 2.0.5)
Net::FTP=GLOB(0x9da13a0)>>> user anonymous
Net::FTP=GLOB(0x9da13a0)<<< 331 Please specify the password.

That certainly looks like a successful FTP connection to me and

Couldnt connect:Net::FTP: connect: Connection refused

obviously isn't, so skip the Firewall setting. It seems to break your setup rather than fixing it.

When you run the script without setting Firewall, is the file README.html created or not? If it is, then everything is working right (more or less) and the main problem is that it didn't print anything to tell you so. If not, then the problem is that timeout and you'll probably want to try FTPing the file using a traditional interactive FTP client to make sure that works before beating your head against this wall too much more.

Replies are listed 'Best First'.
Re^4: Problem with Net::FTP
by cool (Scribe) on Jul 10, 2007 at 14:04 UTC
    Dear dsheroh, As you suggested, I run it without firewall settings and got these messages.
    Net::FTP>>> Net::FTP(2.75) Net::FTP>>> Exporter(5.58) Net::FTP>>> Net::Cmd(2.26) Net::FTP>>> IO::Socket::INET(1.27) Net::FTP>>> IO::Socket(1.28) Net::FTP>>> IO::Handle(1.24) Net::FTP=GLOB(0x8402408)<<< 220-&#65533;w&#65533;&#65533;&#65533;&#655 +33;&#65533;{&#65533;q&#65533;u&#65533;j&#65533;&#65533;&#65533;&#622; +&#1510;&#65533;&#65533;A&#65533;&#65533; Net::FTP=GLOB(0x8402408)<<< 220- Net::FTP=GLOB(0x8402408)<<< 220-&#65533;&#65533;&#65533;&#65533;&#6553 +3;&#65533;&#65533;&#1125;H&#65533;U&#65533;n&#65533;&#65533;&#65533;i +&#65533;&#1124;U&#65533; Net::FTP=GLOB(0x8402408)<<< 220-************************************** +***************************************** Net::FTP=GLOB(0x8402408)<<< 220-/pub/BeOS/ BeOS &#65533;@&#65533 +;~&#65533;t&#65533; Net::FTP=GLOB(0x8402408)<<< 220-/pub/CPAN/ Perl &#65533;{&#65533 +;&#65533;&#65533;y&#65533;&#65533; (Comprehensive Perl Archive Networ +k) Net::FTP=GLOB(0x8402408)<<< 220-/pub/CPatch/ &#65533;&#65533;&#655 +33;&#65533;&#65533;&#435;n&#65533;&#65533; (&#65533;&#65533;&#65533;& +#65533;&#65533;j&#65533;q&#65533;&#65533; Windows &#65533;@&#65533;&# +627;n&#65533;&#65533;&#65533;P&#65533;&#65533;&#65533;&#65533;&#65533 +;&#437;{&#65533;&#65533;) Net::FTP=GLOB(0x8402408)<<< 220-/pub/Documents/ &#65533;U&#65533;&#65 +533;&#65533;&#65533;&#65533;&#944950;&#65533; Net::FTP=GLOB(0x8402408)<<< 220-/pub/FreeBSD/ FreeBSD &#65533;@&#65 +533;~&#65533;t&#65533; Net::FTP=GLOB(0x8402408)<<< 220-/pub/Game/ &#65533;K&#65533;O&#6 +5533;C&#65533;&#65533;&#65533;n&#65533; Net::FTP=GLOB(0x8402408)<<< 220-/pub/Hardware/ &#65533;w&#65533;&#65 +533;&#65533;X&#65533;&#693;{&#65533;&#65533; Net::FTP=GLOB(0x8402408)<<< 220-/pub/Linux/ Linux &#65533;@&#6553 +3;~&#65533;t&#65533; Net::FTP=GLOB(0x8402408)<<< 220-/pub/MsDownload/ &#65533;L&#65533;n&#6 +5533;&#65533;&#65533;&#65533;&#65533;n&#65533;&#65533;&#65533;&#65533 +;&#65533;s (&#65533;&#1190;p Service Pack &#65533;&#65533;) Net::FTP=GLOB(0x8402408)<<< 220-/pub/RFC/ Request for Comments +(RFC &#65533;&#65533;&#65533; Net::FTP=GLOB(0x8402408)<<< 220-/pub/Solaris/ Solaris &#65533;@&#65 +533;~&#65533;t&#65533; Net::FTP=GLOB(0x8402408)<<< 220-/pub/Yesterday/ &#65533;Q&#65533;&#65 +533;&#65533;p&#65533;v&#65533;&#65533;&#65533;&#65533; mirror (&#6553 +3;&#65533;&#65533;&#65533;&#65533;j&#65533;q Windows &#65533;&#65533; +&#65533;&#65533;&#65533;n&#65533; Net::FTP=GLOB(0x8402408)<<< 220-************************************** +***************************************** Net::FTP=GLOB(0x8402408)<<< 220- Net::FTP=GLOB(0x8402408)<<< 220-&#65533;t&#65533;~&#65533;A&#65533;w&# +65533;&#65533;&#65533;&#997;&#938;&#806;h&#65533;h&#65533;Q&#65533;&# +65533; HTTP &#65533;&#65533;&#65533;&#35233;&#65533;n&#65533;J&#65533 +;A&#65533;@&#65533;&#1254;&#65533;&#65533;&#65533;&#65533;&#938;&#655 +33; Net::FTP=GLOB(0x8402408)<<< 220-&#65533;&#511;&#65533;&#65533;&#303;&# +65533;&#65533;A&#65533;&#65533;&#65533;&#65533;&#65533;\&#65533;&#655 +33;&#65533;]&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;& +#65533;&#65533;A&#65533;z&#65533;&#1637;i&#65533;H&#65533;Q&#65533;&# +65533;&#65533;&#622;&#1527;j&#65533;M&#65533;&#65533;&#65533;&#65533; Net::FTP=GLOB(0x8402408)<<< 220-&#65533;&#1459;t&#65533;&#65533;&#6553 +3;&#65533;&#65533;z&#65533;&#1211;&#1896;D&#65533;&#65533;&#65533;&#6 +22;&#1505;A&#65533;&#65533;&#65533;}&#65533;p&#65533;U&#65533;G Net::FTP=GLOB(0x8402408)<<< 220- Net::FTP=GLOB(0x8402408)<<< 220-http://ftp.isu.edu.tw Net::FTP=GLOB(0x8402408)<<< 220 Net::FTP=GLOB(0x8402408)>>> user anonymous Net::FTP=GLOB(0x8402408)<<< 230 Login successful. Net::FTP=GLOB(0x8402408)>>> CWD /pub/CPAN Net::FTP=GLOB(0x8402408)<<< 250-The Comprehensive Perl Archive Network + (http://www.cpan.org/) Net::FTP=GLOB(0x8402408)<<< 250-master site has been from the very beg +inning (1995) hosted at FUNET, Net::FTP=GLOB(0x8402408)<<< 250-the Finnish University NETwork. Net::FTP=GLOB(0x8402408)<<< 250- Net::FTP=GLOB(0x8402408)<<< 250- Net::FTP=GLOB(0x8402408)<<< 250 Directory successfully changed. Net::FTP=GLOB(0x8402408)>>> PASV Net::FTP=GLOB(0x8402408)<<< 227 Entering Passive Mode (140,127,177,17, +236,200) Net::FTP=GLOB(0x8402408)>>> RETR README.html Net::FTP=GLOB(0x8402408): Timeout at ftp1.pl line 9

    NO file has been created in current working directory so far
      OK, no file. So have you tried FTPing that file using any software other than this Perl script? e.g., since you're on Linux:

      wget ftp://ftp.cpan.org/pub/CPAN/README.html

      should be available and do basically the same thing as your script is trying to do. If wget isn't there, you can also try curl or ftp.

      (Incidentally, I just tried this a couple times with wget, and had one mirror time out. Timing out... when using a known-good tool... which is the same way your script is failing... Interesting, no?)