Perl: the Markov chain saw | |
PerlMonks |
eval failure does not set $@by wanderedinn (Sexton) |
on Jun 06, 2018 at 14:46 UTC ( [id://1216032]=perlquestion: print w/replies, xml ) | Need Help?? |
wanderedinn has asked for the wisdom of the Perl Monks concerning the following question:
Hello all,
We are currently using Net::SFTP::Foreign to put/get files to various servers. Recently we discovered that there are times when putting files is not successful, yet we do not receive a failure. We are building the put command on the fly and then executing 'eval $PutCMD'. Following the eval we are check $@ to verify the eval was successful. When the put fails, $@ is not being set. An example of the value of $PutCmd is: $ftp->put("$opt_local_dir/$do_file", "$remote_file",copy_perms => 0, copy_time => 0); Can anyone see why the failure is not detected? It appears that the connection has dropped from the time we connected until the time we attempt to put the file. Currently, in order to determine if the put has failed, we are retrieving a listing of the remote directory following each put attempt. When the put does fail, the listing also fails. Problem is, we are not properly detecting the put failure. Thanks for any insights.
Back to
Seekers of Perl Wisdom
|
|