in reply to Conditional Operator Confusion
for (1..10) { $x = $_ > 5 ? 'foo' : 'bar'; print "$_:$x\n"; }
Ah, I just noticed that you had tried that in your second example. The real issue that you had was that you were trying to treat a trinary operator like an if-else statement. I have tried that before and it just don't work! :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Conditional Operator Confusion
by Melly (Chaplain) on Nov 29, 2006 at 15:48 UTC | |
by Herkum (Parson) on Nov 30, 2006 at 16:44 UTC | |
by Melly (Chaplain) on Nov 30, 2006 at 17:03 UTC | |
by ikegami (Patriarch) on Nov 30, 2006 at 17:12 UTC | |
by Melly (Chaplain) on Nov 30, 2006 at 17:25 UTC |