First, a few questions: Why is the first $ftp->put($file) there?#!/D:/perl/bin/-w # a module making life easier use Net::FTP; use strict; use warnings; require Net::FTP::A; my $file = "ftptest.txt"; my $host = "somehost.com"; my $login = "me"; my $passwd = "pass"; my $ftp = Net::FTP->new("somehost.com", Debug => 1); if ($ftp->login("me","pass")) { $ftp->cwd('OMS'); #$ftp->pasv( $ftp ); $ftp->I(); $ftp->put( $file ); } else { print " Sending file to FTP Server ... Failed!\n"; } print " Sending file to FTP Server ... "; if ($ftp->put($file)) { print "Complete!\n"; } else { print "Failed!\n"; $ftp->quit; } $ftp->quit;
Why isn't your print in the first else clause a die?
Why 2 calls to $ftp->quit()?
Why the "require" of Net::FTP::A? You don't need that, at least, not for this snippet.
Apart from the questions, did you notice that your call to
pasv is commeted out? That could cause you some problems, maybe even the exact problem you mention.
--
Mike
In reply to Re: NET::FTP Problem
by RMGir
in thread NET::FTP Problem
by doesntmatter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |