develooper Front page | perl.perl5.porters | Postings from November 1999

Re: Behaviour of final cleanup

Thread Previous
Ian Phillipps
November 23, 1999 15:29
Re: Behaviour of final cleanup
Message ID:
On Wed, 17 Nov 1999 at 10:03:19 -0800, Gurusamy Sarathy wrote:
> On Wed, 17 Nov 1999 17:48:01 +0100, Raphael Manfredi wrote:
> ># I don't understand the way Perl garbage collects its memory when it dies.
> ># It does not systematically call registered destructors (DESTROY) on objects.
> This would be a bug.  If you have a short test case, that would be good
> to see.

Note that Perl doesn't do any sort of cleanup if you call exec().  This is
right (consider the use of fork+exec), but you need to be aware of it,
especially if tainted evals are available to the user.
I confess to having thought about using this to speed up a program (that
spent 50% of its run time in removing blessed objects with no

Presumably it doesn't clean up on fatal memory exhaustion, either.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About