go ahead... be a heretic | |
PerlMonks |
Re: Burned by precedence rulesby JavaFan (Canon) |
on Dec 23, 2008 at 14:15 UTC ( [id://732295]=note: print w/replies, xml ) | Need Help?? |
I use all of and, &&, or, ||, ! and not. I don't find it hard to remember that the old, punctuation ones are "high" precedence (just as in C), and the newer English ones are "low" precedence.
Given two operators, most of the time I know which one has a higher precedence, certainly for operator combinations I use more frequently. But sometimes, I'm not sure. If I'm not sure, I use parenthesis. Or sometimes, I use -MO=Deparse,-p to find out.
In Section
Meditations
|
|