in reply to Lexical Scoping and Anonymous Subroutines Passed To Functions
Yeah, it's a known quirk. Perl doesn't think it needs to bind $y in the inner sub because it needn't in the outer sub, whereas it did have to bind $x in the outer sub. (btw - that inner bare block, around the Doit call, is superfluous; removing it doesn't change the behavior, and, I think, clarifies the situation somewhat.)
|
|---|