![]() |
|
P is for Practical | |
PerlMonks |
Re^5: Finding file level lexical variablesby LanX (Saint) |
on May 26, 2016 at 12:37 UTC ( #1164188=note: print w/replies, xml ) | Need Help?? |
What exactly is your point? Not sure what you expect. ... You are using peek_my(0) , the file scope variables are from the outer scope but never used, so they are not really integrated in the pad and should be already destroyed at the time of your printing. (By ref counting, but digging in memory might still show the old content) PadWalker is reading internals in unofficial ways and can't be more intelligent as their structures. Always be prudent about side effects. Anyway, the case of the OP is easily solved with peek_my(1)
updateIf I were you I'd do the introspection and analysis in the sub before any destruction can have happened! Do not return references.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|