my $output = $ssh->capture({ timeout => 10 }, "echo hello; sleep 20; echo bye"); $ssh->error and warn "operation didn't complete successfully: ". $ssh->error; print $output;