I've written a script that uses net::FTPSSL from unix to windows, to upload a file to make sure ftp is working. It works fine. I was trying to generate an error where the file to upload was not found an instead of emailing me an error, it just printed one to the screen that the file wasn't found. I am trying to check the return code from the ftps but I am very new to this. This statement works if it can't put the file up but not if the file doesn't exist.
$ftps->put("/temp/testuploadfile.txt") or emailerr("Error: $0 could upload testftpsfile to FTPS server at IP $ftpsip with FTPS p
rotocol.", $ftps->$last_message() );
I was researching and checking debug output and see 226 is a successful put, but I don't know how to check that.
How do I check the return code? I was trying to use something like this but it didn't work
my $rtncode=$ftps->code;
if ($rtncode != 226 && $rtncode != 250)
{
my $msg=$ftp->message;
print "FTP Failed: $msg\n";
$ftp->quit;
}
OR
###print "error $Net::FTPSSL::ERRSTR";
Any help wourl be appreciated.