The || and or operators differ in the evaluation of their operands. It probably 
doesn't matter in this particular case but don't be fooled into thinking they are the 
same.

|| and && are "short circuit" operators that may not evaluate all of their operands.

Programming Perl, 3rd edition,, page 102

At 11:42 -0500 11/21/03, Chris Devers wrote:
>On Fri, 21 Nov 2003, Jeremy Mates wrote:
>
>> * Chris Devers <[EMAIL PROTECTED]>
>>
> > >    open(FILE,">hello.txt") || die("Cannot Open File: $!");
>>
>> I find '||' far less readable than 'or', and far more likely to cause
>> precedence problems. Though I do write fairly () free Perl code.
>
>Agreed, but I was trying not to nitpick :)
>
>I was trying to focus on the 'structural' issues, not 'stylistic' ones,
>but now that you mention it, the English versions of some of the operators
>('or' instead of '||', 'and' instead of '&&') do seem to make code much
>more readable.
>
>    open(FILE,">hello.txt") or die("Cannot Open File: $!");


-- 
--> As a citizen of the USA if you see a federal outlay expressed in $billion then 
multiply it by 4 to get your share in dollars. <--

Reply via email to