Print your debug information on STDERR

cog on 2005-02-15T17:59:48

One thing I do from time to time is to open a file to write to it in the STDOUT filehandle... (and I am also known for reading a file via STDIN)

This saves me the time (and keystrokes) of using a filehandle name (or even picking one up).

Today, for the first time ever, this caused me a bug (fortunately, it only took me about 10 minutes to figure out what was happening)... you see, I was printing debugging information which was screwing up the output file...

Always remember, print your debug information on STDERR at all times :-)


Save Keystrokes!

chromatic on 2005-02-15T18:17:24

Save time and spell it warn.

Wrong solution :)

melo on 2005-02-16T11:06:35

Nopes,

the correct solution is always, *always* use Log::Log4perl.

By default, it does what you want, and eventually, when you really need it, it will do it also, whatever it is...

Clear as mud, I hope... :)