Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to create a log file?

by mr.nick (Chaplain)
on Dec 22, 2011 at 13:48 UTC ( [id://944777] : note . print w/replies, xml ) Need Help??


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 ...