C:\>more perl.stdout.fork.pl use strict; use warnings; if (my $pid=fork() ) { sleep(1); print "parent\n"; } else { close STDOUT; open STDOUT, '>'. __FILE__.'.temp' or die $!; print "print child$/"; system("echo echo child"); # printed to console, not to .temp } C:\>perl perl.stdout.fork.pl echo child parent C:\>more perl.stdout.fork.pl.temp print child