not all programming languages guarantee the order in which terms are evaluated, or even short-cutting.Fortunately, we're talking about Perl here, not about "all programming languages", and Perl does guarantee a specific order of operations in which || is very-high-precedence, or is very-low-precedence, and shortcut evaluation is the rule.
I'm curious, though... Could you name a couple of languages in which the order of operations is not guaranteed? I don't think I've ever seen one myself and I have a hard time imagining the practical use of having an indeterminate order of operations.
Just as if (and unless) can be used as a modifier, else could be used as a modifier.Not all programming languages allow the use of if or unless as statement modifiers, nor the use of else in that fashion. If using or for flow control is bad practice because it's not reliable in other languages, then surely the use of statement modifiers is just as bad.
That would be clear indication of intent.As a native speaker of English, I find "open or die" to be a vastly clearer statement of intent than "open else die".
In reply to Re^7: next unless condition
by dsheroh
in thread next unless condition
by hankcoder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |