Thanks all for the help and suggestions!
Net::OpenSSH::Parallel looked promising. But at the time I started the project, the CPAN documentation had a note that it was still an alpha version. So I did not install it.
My example used the fork() function, but I actually use forks.pm. I like the Perl threads feature, but my binary is not complied with support for it. Among other things, I need to run other tasks in parallel besides just SSH commands, and I also need to do some IPC between the processes. The Perl threads feature is a lot easier to use for IPC than pipes and other pure-UNIX solutions.
I just downloaded version 0.48 of the module and modified the DESTROY method, from
if ($pid) {
to
if ($pid && $perl_pid == $$) {
This solves the problem.
Best Regards,In reply to Re^2: Net::OpenSSH and fork()
by scotchie
in thread Net::OpenSSH and fork()
by scotchie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |