#!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"); ...