in reply to Making debug a little more intelligent

I generally use something like
print LOG "message" if $debug <= 2;
Of course, I open the log and set the $| =1 in BEGIN. In one system, I do not open it if $debug == 0 and I close it/open it if the user changes $debug to/from 0 at runtime (which happens to be through a GUI).

HTH, --traveler