I was looking to do the same thing for STDERR and the answer I came up with seemed a little simpler:
open( logFile, ">log.txt"); *STDERR = *logFile;
Any reason why this shouldn't be used?
In reply to how do i redirect STDOUT, STDIN, or STDERR to a FILE? by Ectaris
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |