dwalin has asked for the wisdom of the Perl Monks concerning the following question:
#!perl -w use Net::OpenSSH; my $ssh = Net::OpenSSH->new("hostname"); if (my $pid = fork) { # wait for children, do something } elsif ($pid == 0) { exec "another_perl_script"; } __END__ another_perl_script: #!perl -w use Net::OpenSSH; # do something to retrieve master connection my $ssh = Net::OpenSSH->... $ssh->system("remote command"); ...
Perhaps I wasn't attentive enough but I can't find a way to pass master socket to new(). I can pass it the same control directory but that results in Net::SSH creating another master connection.
Thanks in advance!
Regards,
Alex.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net::OpenSSH across fork & exec
by salva (Canon) on Mar 15, 2011 at 16:56 UTC | |
by dwalin (Monk) on Mar 15, 2011 at 20:21 UTC | |
by salva (Canon) on Mar 16, 2011 at 08:45 UTC | |
by bibliophile (Prior) on Mar 16, 2011 at 15:17 UTC |