I'm not sure why it is behaving differently if the file doesn't exist - can you show how you create the ftps object?
You can always check yourself that the file exists before calling put:
if ( ! -e $file ) {
emailerr("$file does not exist");
}
else {
$ftps->put($file);
}
To check if put() was successful you only need to see if the last FTP status code starts with "2", so:
my $rtncode = $ftps->last_status_code;
if ( $rtncode != 2 ) {
# deal with error
}
Note: last_status_code() returns the first digit from the full 3 digit response code.