open(STDOUT, ">my_file") ; select STDOUT; $| = 1; #### close STDOUT ; open STDOUT,">&1" or die "Cannot do it" ;