develooper Front page | perl.perl5.porters | Postings from December 2004

RE: [perl #32714] Objects destroyed in the wrong order during global destruction

Thread Previous | Thread Next
From:
Orton, Yves
Date:
December 2, 2004 09:45
Subject:
RE: [perl #32714] Objects destroyed in the wrong order during global destruction
Message ID:
E471ED2DFD9353458E8B75FD6D6B0307B638A4@defra1ex4.de.mcilink.com

> Subject: [perl #32714] Objects destroyed in the wrong order during global
destruction 

I thought order of destruction in perl in general was undefined? At least
Perltoot seems to agree with me:

"Perl's notion of the right time to call a destructor is not well-defined
currently, which is why your destructors should not rely on when they are
called."

There is also something on the subject in perlobj.pod but it doesn't say
that there is a defined order. 

Im wondering why Perl doesn't have a counter whose value is incremented and
assigned to each blessed object when they are blessed. Then in global
destruction Perl could ensure that the objects are destroyed in the correct
order (hmmm, would that be oldest first or newest first?). Is it just
because the memory overhead is too much for the gain to be worthwhile?

Yves


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About