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
In reply to Error Checking with Net::FTP by nickfaber
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |