This line is tripping you up:
open ( LOG, $log ) || warn " Couldn't open log\n" if ($debug);
It'll only open the file if the $debug flag is true. The if is much higher in precedence than ||. This will work instead:
open( LOG, $log ) or do { warn " Couldn't open log: $!\n" if $debug; };
In reply to Re: Filehandle open or not - WTF? :(
by chromatic
in thread Filehandle open or not - WTF? :(
by Rhodium
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |