in reply to Re: Net::OpenSSH and fork()
in thread Net::OpenSSH and fork()

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,
Scott

Replies are listed 'Best First'.
Re^3: Net::OpenSSH and fork()
by salva (Canon) on Aug 07, 2010 at 08:07 UTC
    the CPAN documentation had a note that it was still an alpha version

    Yes, it still says so, I am probably being too conservative there, I should move it to beta!

      I noticed that Net::OpenSSH version 0.49 includes the fix. Thanks!