in reply to The perils of being tricky
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: The perils of being tricky
by mstone (Deacon) on Jun 04, 2005 at 19:12 UTC | |
by kaif (Friar) on Jun 04, 2005 at 19:24 UTC | |
by mstone (Deacon) on Jun 04, 2005 at 19:32 UTC | |
by gaal (Parson) on Jun 05, 2005 at 07:22 UTC | |
|
Re^2: The perils of being tricky
by ysth (Canon) on Jun 05, 2005 at 07:50 UTC |