Re: BEGIN, INIT etc...

Re: BEGIN, INIT etc...

am 29.03.2008 14:29:40 von Joost Diepenmaat

Bart Lateur 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/