mds has asked for the wisdom of the Perl Monks concerning the following question:
Is it possible to capture the output of stderr in Net::OpenSSH to a variable instead of to a file? In this particular case I want the stderr of the following "new" function not the stderr of commands once I have the connection established.
my $ssh = Net::OpenSSH->new($host); $ssh->error and die "Couldn't establish SSH connection: ". $ssh->error;
ssh->error does not provide all the information I need during a connection failure.
I get different reasons for failure to connect. Some are
"administratively denied" other are just "disconnect" and all these messages go to stderr. It looks like I can capture the stderr to a file but I would like to avoid that if possible.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Handling STDERR when using Net::OpenSSH
by jandrew (Chaplain) on Aug 20, 2013 at 17:23 UTC | |
|
Re: Handling STDERR when using Net::OpenSSH
by kevbot (Vicar) on Aug 21, 2013 at 04:45 UTC | |
by mds (Novice) on Aug 21, 2013 at 13:39 UTC | |
|
Re: Handling STDERR when using Net::OpenSSH
by salva (Canon) on Aug 26, 2013 at 09:00 UTC |