use feature qw( say ); use IPC::Open3 qw( open3 ); open(local *TO_CHLD, '<', '/dev/null') or die $!; my $pid = open3( 'STDERR', 'perl', '-E', 'sleep 2; say $$;' ); say time, ": ", $pid; while () { print time, ": Perl said: $_"; } waitpid($pid, 0); #### 1327100100: 27601 1327100102: Perl said: 27601