Thanks for the reply Salva! Would this be at the SSH session creation time? Or when the threads are reaped?
Should the master_exited call be here?
As in:
# For Net::OpenSSH need to specify whether to create
# pipes or not, default is no pipes.
my %opts;
$opts{stdin_pipe} = 1;
$opts{stdout_pipe} = 1;
$opts{stderr_to_stdout} = 1;
# Kick off the script on the remote machine
($ssh{'STDIN'}, $ssh{'STDOUT'}, undef, $ssh{'PID'}) =
$ssh{'SSH'}->open_ex(\%opts, $script)
or die "Error ".$ssh{$host}->error;
$ssh{$host}->master_exited()