in reply to Re^4: my (0?$a:$b): a koan
in thread my (0?$a:$b): a koan
What the reason is that my(my $x) and my(0?$x:$y) are accept isn't clear to me.
my(0?$x:$y) gets constant-folded to valid my($y). The validity checker apparently runs after constant-folding.
$lex and my $lex are the same op. The only difference is the LVINTRO flag. The validity checker apparently doesn't check the flag.
Can't localize lexical variable $x
This is consistent with my guess at the workings, that any variable lookup in the my argument expression is taken to be a lexical declaration. local craps out on the lexical passed to it. (Don't forget, local doesn't declare variables.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: my (0?$a:$b): a koan
by ambrus (Abbot) on May 05, 2011 at 19:24 UTC | |
by mr_mischief (Monsignor) on May 06, 2011 at 06:16 UTC | |
by ikegami (Patriarch) on May 06, 2011 at 06:23 UTC | |
by mr_mischief (Monsignor) on May 06, 2011 at 06:28 UTC |