$sftp->put(...); if ($sftp->error) { ... }; #### my $sftp = Net::SFTP::Foreign->new(..., autodie => 1); #### $Net::SFTP::Foreign::debug = -1;