![]() |
|
Think about Loose Coupling | |
PerlMonks |
Re^3: Scope of lexical variables in the main scriptby Anonymous Monk |
on Apr 20, 2012 at 06:07 UTC ( #966092=note: print w/replies, xml ) | Need Help?? |
$tricky stays alive as long as there is a reference to it, all the way up until perl exits. Here is another circular reference, a self-referential variable, it lives even after its inaccessible
Well, you could use trickery like PadWalker to get at $TRICKIEST, but that is cheating :) See Tutorials: Variable Scoping in Perl: the basics, Coping with Scoping Mini-Tutorial: Perl's Memory Management Memory leaks and circular references, Circular references and Garbage collection., make perl release memory
In Section
Seekers of Perl Wisdom
|
|