Lightning flashed, thunder crashed and Stephanie Stiavetti <[EMAIL PROTECTED]> whispe
red:
| you know, our super webmaster perl guy said that you shouldn't use || in die
| statements, because in the order of precedence || comes before 'or' and that
| in a die statement, it can mess things up.
| 
| now, I question his opinion seeing as how EVERYONE uses || instead of 'or'.
| can you clarify?

|| and 'or' are exactly the same, except the precedence levels are
different.  If you understand precedence, and how to manipulate it, you can
use either.

open FOO, "foo" or die "Blah: $!\n":
open(FOO, "foo") || die "Blah: $!\n";

A lot of old timers (and/or C programmers) use the second form.  'or' is an
addition to perl 5 that earlier perl's didn't have, and that C doesn't
have.  So, it has become habit over the years.

-spp
--
Stephen P Potter                                         [EMAIL PROTECTED]
"You can't just magically invoke Larry and expect that to prove your point.
Or prove that you have a point."        -Simon Cozens
UNIX, Perl, PHP, Web Consulting and Training  http://www.unixlabs.net/~spp/

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

Reply via email to