in reply to How to create a log file?

When I need quick and dirty logging that doesn't affect the output of my script, I do this:

use strict; use warnings; open STDERR,">","$0.log" or die $!; ... ... warn "this goes to my log file"; ... print "but this doesn't\n"; ....

mr.nick ...