On Tue, 31 Jul 2001, Christiam Camacho wrote:

>      Is the only difference between "and" and "&&" and
> "or" and "||" the precedence of the operators?
> In other words, how do these statements differ (e.g.:
> is any more efficient than the other?):
>
> open(FH,$in_file) or die "Couldn't open $in_file: $!"
> open(FH,$in_file) || die "Couldn't open $in_file: $!"

Consider this:

open FH,$in_file or die "Couldn't open $in_file: $!"
open FH,$in_file || die "Couldn't open $in_file: $!"

There's most definitely a difference here, without the parentheses.  The
comma operator has a lower precedence than || (but not or), and it will
change how these statements are evaluated.

-- Brett
                                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
We are what we are.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to