my @output = $ssh->capture($_); if ($ssh->error) { print STDERR "capture failed: " . $ssh->error; } else { print @output, "\n"; }