I'm using Net::SFTP::Foreign with plink as the SSH command:
$sftp=Net::SFTP::Foreign->new("mysite.com",
user=>"myuser"
,ssh_cmd=>'plink'
,more =>
);
If I have a connection error like a bad password, the plink command returns a message like "Access denied" to STDERR. But $sftp->error contains the message "Connection to remote server is broken", which isn't very useful to a support person looking at a log.
Is there a way to capture the output of the plink command inside my program?