my $cmd = q(perl -e 'die'); my $pid = open(ERROR, "$cmd 2>&1 1>/dev/null |"); print "$pid\n"; while () { print "ERROR: $_\n"; }