open( LOG, ">>", "log.txt" ) or die "Can't' write to log.txt: $!\n"; *STDOUT= *LOG; print "Yay! This goes to log.txt! Success!\n"; # Reason 1: system("echo Boo, this goes to the old STDOUT"); # Reason 2: close STDOUT; print LOG "Boo, this goes nowhere but I didn't close *LOG!\n"; # Reason 3: open STDOUT, '>>', 'newlog.txt' or die "Can't write to newlog.txt: $!\n"; system("echo Boo, this still goes to old STDOUT despite reopening");