in reply to Problem with Net::FTP
That may help in isolating the problem.use warnings; use strict; use Net::FTP; my $ftp=Net::FTP->new("ftp.cpan.org", Debug => 1) or die "Couldnt connect:$@\n"; $ftp->login("anonymous"); $ftp->cwd("/pub/CPAN"); $ftp->get("README.html"); $ftp->close;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with Net::FTP
by cool (Scribe) on Jul 10, 2007 at 13:16 UTC | |
but now if I add as tirwhan suggested, Where XXXX- proxy of my institute I am getting message Couldnt connect:Net::FTP: connect: Connection refused | [reply] [d/l] [select] |
by dsheroh (Monsignor) on Jul 10, 2007 at 13:48 UTC | |
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
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. | [reply] |
by cool (Scribe) on Jul 10, 2007 at 14:04 UTC | |
NO file has been created in current working directory so far | [reply] [d/l] |
by dsheroh (Monsignor) on Jul 10, 2007 at 15:06 UTC | |
by rpanman (Scribe) on Jul 10, 2007 at 15:16 UTC | |
... 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... Maybe you can try active mode and see if that works. You can do this using the following line: Hope that helps. | [reply] [d/l] [select] |