in reply to How do I output error messages to a file?

Redirect STDERR from within the program:
open STDERR, ">", "/path/to/log";



Code is (almost) always untested.
http://www.justicepoetic.net/