in reply to Net::SCP::Expect Error Handling
The Expect object used internally to handle interaction with the slave scp process is not exposed. I can't see a way to retrieve the output.
Anyway, let my present you Net::OpenSSH which is able to do what you are asking for:
use Net::OpenSSH; my $ssh = Net::OpenSSH->new($host, user => $user, password => $pass); unless ($ssh->scp_get({ stdout_file => './scp-capture', stderr_to_stdout => 1 }, $src_path, $dst_path)) { say "SCP failed: " . $ssh->error; ... }
update: oops! s/stdin/stdout/g !!! There was also a missing parenthesis.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Net::SCP::Expect Error Handling
by siddhanta (Initiate) on Jan 29, 2016 at 08:43 UTC | |
by salva (Canon) on Jan 29, 2016 at 08:51 UTC | |
by siddhanta (Initiate) on Jan 29, 2016 at 11:20 UTC | |
by salva (Canon) on Jan 29, 2016 at 12:38 UTC | |
by siddhanta (Initiate) on Jan 29, 2016 at 11:03 UTC | |
by salva (Canon) on Jan 29, 2016 at 11:11 UTC |