P is for Practical | |
PerlMonks |
Re: Lexical pad / attribute confusionby djantzen (Priest) |
on Dec 21, 2002 at 23:48 UTC ( [id://221686]=note: print w/replies, xml ) | Need Help?? |
If my understanding of Elian's explanations in Perl Internals - references and symbol table is correct, the reason is because %foo and %bar are just bare blocks, and as such do not get their own pads. Rather, they share the pad of the enclosing sub, which is that of the package, and therefore the INIT block can see them as well when peek_my inspects the package's pad.
In Section
Seekers of Perl Wisdom
|
|