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.)
In reply to Re^5: my (0?$a:$b): a koan
by ikegami
in thread my (0?$a:$b): a koan
by educated_foo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |