Here's a way not to have to put parentheses around everything. Use the unary + operator:
print +( 'b == a', 'b < a', 'b > a', )[$a <=> $b], "\n";
In reply to Re: The perils of being tricky
by gaal
in thread The perils of being tricky
by mstone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |