The ternary operator here has a higher precedence than the print that works as a list operator, so Perl does the right thing.$ perl -MO=Deparse,-p -e'print $var ? "yes" : "no";' print(($var ? 'yes' : 'no')); -e syntax OK
Makeshifts last the longest.
In reply to Re^4: if-else vs. tertiary effieciency?
by Aristotle
in thread if-else vs. tertiary effieciency?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |