in reply to IP Accounting parser
Erk! This code:
does not act the way you want it to. Because the || has a higher precedence than the comma, what actually happens is this:open FILE, $logfile || die $!;
see perlop for the complete precedence list.open FILE, ($logfile || die $!);
If you really want to use the || then put parenthesis around things like so:
open (FILE, $logfile) || die "Could not open $logfile: $!\n";
Better yet, use the super-low-priority or, which allows you to acheive your original effect:
open FILE, $logfile or die "Could not open $logfile: $!\n";
Best of all, be correct and non-ambigous and use both:
open (FILE< $logfile) or die "Could not open $logfile: $!\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: IP Accounting parser
by Viking (Beadle) on Jan 12, 2001 at 08:58 UTC | |
by turnstep (Parson) on Jan 12, 2001 at 18:02 UTC |
In Section
Code Catacombs