Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Net::OpenSSH across fork & exec

by salva (Abbot)
on Mar 16, 2011 at 08:45 UTC ( #893512=note: print w/replies, xml ) Need Help??


in reply to Re^2: Net::OpenSSH across fork & exec
in thread Net::OpenSSH across fork & exec

yes, now, it works as follows:
#!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", $ssh->get_ctl_path; } __END__ another_perl_script: #!perl -w use Net::OpenSSH; my $ssh = Net::OpenSSH->new($host_or_some_dummy_value, ctl_path => $ARGV[0], reuse_master => 1); $ssh->system("remote command");

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://893512]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2020-11-29 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?