go ahead... be a heretic | |
PerlMonks |
Re^8: SSH2 - Asynchronous Opens & Synchronous Commandsby 5haun (Scribe) |
on Apr 06, 2014 at 15:57 UTC ( [id://1081314]=note: print w/replies, xml ) | Need Help?? |
Of course! (head slap) :) I was already gathering the info, but didn't think of using it to automatically pull the error:
The '-v' to enable debugging is not required in this case, as the error message (or nothing) will be written to the file with $ssh_debug = 0. I believe the important concept here is the cause of error message always appears to be the last line output to the master_stderr_fh file. Something like the following (combined with the above) appears to provide a more accurate error message:
It should be noted there will be a linefeed on the end of $lasterr (it's left up to the user to chomp it off if they don't want it). It should also be noted that master_stderr_fh cannot be assigned to an in-memory file, or the following error will be received:
Thanks again. The full solution will be posted when it is done (I'm juggling a couple of other things while doing this, so sorry it's taking a while).
In Section
Seekers of Perl Wisdom
|
|