#my $cmd = "$rsh_cmd -l $user $host \"$perl_loc - $main::sc_destdir @main::sc_destsubdirs\"\n"; my ($in, $out, $err) = (gensym(), gensym(), gensym()); my $pid = open3($in, $out, $err, $cmd); my $sis_fname = $main::fp_syscheck_install_status_pl; # above is another local perl script which is to be run on remote machine my $fh = new FileHandle "<$sis_fname"; die "Unable to open $sis_fname" unless ($fh); my @sis = <$fh>; print $in @sis; close ($in);