in reply to Filehandle open or not - WTF? :(
You're trying to do too much on one line:
open ( LOG, $log ) || warn " Couldn't open log\n" if ($debug);
Here's how it deparses:
$ perl -MO=Deparse,-p -e 'open F, shift || warn $! if $debug' ($debug and open(F, (shift(@ARGV) || warn($!))));
In other words, you only try to open the filehandle if $debug is true.
Cheers,
Ovid
New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Filehandle open or not - WTF? :(
by Rhodium (Scribe) on Mar 11, 2003 at 23:20 UTC | |
by IlyaM (Parson) on Mar 11, 2003 at 23:42 UTC | |
by Aristotle (Chancellor) on Mar 15, 2003 at 12:59 UTC |