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.

Replies are listed 'Best First'.
Re^2: debugging Net::Sftp::Foreign using ssh2
by sdetweil (Sexton) on Dec 12, 2012 at 20:11 UTC
    >In order to activate debugging set... $Net::SFTP::Foreign::debug = -1; where did you find that? there are all kinds of workarounds here, but nothing that straight forward.. thank you.. adding the debug, it does not fail..typical!.. but the debug output is good..

      I can't find where I read it, but I believe $Net::SFTP::Foreign::debug is a bitmask, so -1 (equivalent to all ones in binary*) is saying "show me everything".

      * for 2's compliment based systems