|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re^3: Scope of lexical variables in the main scriptby nemesdani (Friar) |
| on Apr 20, 2012 at 06:58 UTC ( [id://966108]=note: print w/replies, xml ) | Need Help?? |
|
And if you want to even more tricky, and thinking in OOP terms, you can weaken the reference (from perldoc: http://perldoc.perl.org/Scalar/Util.html): weaken REF REF will be turned into a weak reference. This means that it will not hold a reference count on the object it references. Also when the reference count on that object reaches zero, REF will be set to undef. This is useful for keeping copies of references , but you don't want to prevent the object being DESTROY-ed at its usual time. I'm too lazy to be proud of being impatient.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||