more useful options | |
PerlMonks |
Re: Re: Re: Object reference disappearing during global destructionby erikharrison (Deacon) |
on May 16, 2002 at 04:34 UTC ( [id://166918]=note: print w/replies, xml ) | Need Help?? |
Let me give it a shot. First off, let me make sure I understand. You have a reference to an object, and you are dereferencing that ref in print statements, wondering whats going on, right? If you have a reference to an object, then the destruction of that reference will not invoke a call to a DESTROY method, only the objects actual destruction will. The objects destruction will occur in a pass before destruction of anything else. If you have a reference to an object, and the object is destroyed first (which it should be) the the reference points to nothing - undef. If the the scalar holding the reference to the object is itself undefed, and the object still exists, then this may be inconsistent with Perl's two pass out-of-the-pool system (where objects go first, so that their DESTROY methods can safely operate on variables in the environment). But, if you simply have a reference to the object, and you dereference that reference, then it should come up undef after global object destruction and before destruction of everything else. Hope that helps. Cheers,Erik Update: I just realized this is my 100th post. Yay!
In Section
Seekers of Perl Wisdom
|
|