defined(my $pid = open my $child, "|-") or die "$!"; if ($pid){ # parent print $child "$args"; } else { #child my $args = ; } # or for an exec, at least run $^X instead of "perl": open my $child, "|$^X", $scriptfile;