in reply to my (0?$a:$b): a koan
which is a known issue, and may do unexpected things if EXPR is false (although there has been code out there that (mis)uses this). Since 5.10 there has been a warning onmy $x = 3 if EXPR; my $y = 3 if !EXPR;
is EXPR can be determined to be false at compile time (constant folded to 0).my $x if EXPR;
I wouldn't worry about my(0?$x:$y) too much. It's not something people will be do by accident - it isn't documented to work, so people who do it shouldn't be surprised if their code no longer works after upgrading Perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: my (0?$a:$b): a koan
by educated_foo (Vicar) on May 05, 2011 at 14:42 UTC | |
by ikegami (Patriarch) on May 05, 2011 at 16:26 UTC | |
by JavaFan (Canon) on May 05, 2011 at 16:58 UTC | |
by ikegami (Patriarch) on May 05, 2011 at 18:16 UTC | |
by ambrus (Abbot) on May 05, 2011 at 19:24 UTC | |
|