in reply to Redirecting STDIN / STDOUT after fork

print STDOUT "hey1"; { local *STDOUT; open( STDOUT , ">test" ); print STDOUT "hey2"; } print STDOUT "hey3";
__________________
Hope this helps