nickfaber has asked for the wisdom of the Perl Monks concerning the following question:
Every time it runs it says the put failed. Thanks in advance, Nicksub PutFTP { ################################################################## +######################## # # This subroutine performs an FTP Put using the Net::FTP module # ################################################################## +######################## my $ftp_server = shift(@_); my $sub_pass = shift(@_); my $sub_uid = 'weblog'; my $sub_path = shift(@_); my $sub_log = shift(@_); print "Beginning FTP Put to $ftp_server. Putting log $sub_log to p +ath $sub_path\n\n"; print "FTP Debug output:\n\n"; my $ftp = Net::FTP->new("$ftp_server", Debug => 1, Timeout => 1300 +) or ErrorOut("Cannot connect to $ftp_server: $@"); $ftp->login($sub_uid,$sub_pass) or ErrorOut("Cannot login ", $ftp->message); $ftp->cwd($sub_path) or ErrorOut("Cannot change working directory ", $ftp->message); $ftp->put($sub_log) or ErrorOut("put failed ", $ftp->message); $ftp->quit; print "\nEnd FTP debug output\n\n"; if ($ftp->put($sub_log)) { print "FTP Put successful from server $ftp_server\n"; }else{ print "FTP Put Failed\n"; } } # End sub NetFTP
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error Checking with Net::FTP
by starX (Chaplain) on Jan 07, 2008 at 19:11 UTC | |
by nickfaber (Initiate) on Jan 07, 2008 at 19:30 UTC | |
by vlademonkey (Pilgrim) on Jan 07, 2008 at 19:45 UTC | |
by starX (Chaplain) on Jan 07, 2008 at 19:41 UTC | |
by nickfaber (Initiate) on Jan 07, 2008 at 19:33 UTC | |
by derby (Abbot) on Jan 07, 2008 at 19:48 UTC | |
|
Re: Error Checking with Net::FTP
by derby (Abbot) on Jan 07, 2008 at 18:52 UTC |