in reply to Net::OpenSSH mutliple commands
One way to overcome that is to join all the commands together:
$ssh->system("cd $dir && tar czf /tmp/file.tgz .");
In your case, you can also eliminate the scp_get step transferring the archive as it gets generated:
$ssh->system({stdout_file => '/tmp/file.tgz'}, "cd $dir && tar czf - . +");
|
|---|