http://qs321.pair.com?node_id=1008512


in reply to debugging Net::Sftp::Foreign using ssh2

The way to check for errors on Net::SFTP::Foreign is calling the error method:
$sftp->put(...); if ($sftp->error) { ... };
Or alternatively, use the autodie feature:
my $sftp = Net::SFTP::Foreign->new(..., autodie => 1);
In order to activate debugging set...
$Net::SFTP::Foreign::debug = -1;

Also, note that libssh2/Net::SSH2 are somewhat buggy. Ensure that at least you are using the latest versions.