My best guess is that perl thinks that $x is not used within foo(), so it doesn't bother to keep track of it -- unless you reference $x directly within foo(). Maybe it doesn't look into the inner sub or something.
That's exactly it. It's probably done as an optimization. If foo doesn't use $x, it's not available to child functions either.
Yeah, it should give a strict error.
In reply to Re: Doubly-nested deeply bound variable is undefined
by ikegami
in thread Doubly-nested deeply bound variable is undefined
by asokoloski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |