in reply to Re^3: Perl Parsing Based on Supplied Precedence
in thread Perl Parsing Based on Supplied Precedence
"&&" and "and" have differing precedences. "and" is lower precedence than "&&". The same goes for "||" and "or"; "or" has lower precedence than "||". "and" actually has lower precedence than "||", as I will demonstrate.
code with "&&":
perl -e 'if(0&& 0||1){print"hello\n"}'
output:
hello
code with "and":
perl -e 'if(0and 0||1){print"hello\n"}'
(outputs nothing)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Perl Parsing Based on Supplied Precedence
by wirito (Acolyte) on Nov 07, 2012 at 12:01 UTC | |
by protist (Monk) on Nov 07, 2012 at 12:09 UTC |