in reply to how do i redirect STDOUT, STDIN, or STDERR to a FILE?

Nope, but there are limitations to it. Anything that uses file descriptor 2 (e.g. system) to mean STDERR won't see your change. Better:
open(STDERR, ">log.txt")