in reply to Re^3: Strange Regex Behavior
in thread Strange Regex Behavior
Hm. I believe the fact that the entire ternary expression is wrapped in parens means that the contents of those parens must be evaluated before anything outside them per perlop:
A TERM has the highest precedence in Perl. They include variables, quote and quote-like operators, any expression in parentheses, and any function whose arguments are parenthesized.
I also believe that as the two ternary expressions are part of a (4-term) comma separated list, those four terms should be evaluated in strictly left to right order per perlop:
"In list context, it's just the list argument separator, and inserts both its arguments into the list. These arguments are also evaluated from left to right.".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Strange Regex Behavior
by quester (Vicar) on Dec 06, 2011 at 09:08 UTC |