I set timeout=1 in $ssh->capture2,but this don't return after 1 seconds, and this error message is "ssh slave failed: timed out"
#!/usr/bin/perl
use strict;
use Net::OpenSSH;
my $host='192.0.0.11';
my $user='oracle';
my %param=(
user => $user,
password=>'xxxxxx',
timeout => 10,
port => '22'
);
my $ssh = Net::OpenSSH->new($host,%param);
my ($stdout,$stderr) = $ssh->capture2({timeout => 1},"echo hello; slee
+p 10; echo bye");
if($stderr){
print $stderr;
}
$ssh->error and
warn "operation didn't complete successfully: ". $ssh->error;