This is my 1st snippet posting so please be gentle.
$debug = 1; # toggle to 0 to turn off debug if ($debug) { open(FH, ">-") or die "Unable to open STDOUT: $!\n"; } else { open(FH, ">/tmp/var/$0$$.log") or die "Unable to open $0$$.log $!\ +n"; } print FH "If \$debug = 1 this will print to log otherwise print to the + screen(STDOUT)\n";
In reply to Printing "log" output while debugging by sweetblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |