Re: BEGIN, INIT etc...

Bart Lateur <bart.lateur [at] pandora.be> writes:

> Joost Diepenmaat wrote:
>
>>END blocks are useful to "guarantee" that code gets run when the program
>>ends, even if for example an exception is thrown. Useful for system
>>resources that may not get freed properly otherwise.
>
> Unfortunately they're still not called on exit and on exec.

They are called on exit(), just not on POSIX::_exit

$ perl -w -Mstrict -e'END{ print "END"}; exit'
END

Cheers,
Joost.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Joost Diepenmaat [ Sa, 29 März 2008 14:29 ] [ ID #1931941 ]
Perl » comp.lang.perl.misc » Re: BEGIN, INIT etc...

Vorheriges Thema: Re: empty variables - getting rid of "uninitialized value" warnings?
Nächstes Thema: FAQ 7.24 How can I catch accesses to undefined variables, functions, or methods?