Re: FAQ 8.18 How can I do an atexit() or setjmp()/longjmp()? (Exception handling)



On Aug 7, 6:37 pm, brian d foy <brian.d....@xxxxxxxxx> wrote:
In article <lniqh4o31c....@xxxxxxxxxxxxxxx>, Keith Thompson

<ks...@xxxxxxx> wrote:
PerlFAQ Server <br...@xxxxxxxxxxxxxx> writes:
8.18: How can I do an atexit() or setjmp()/longjmp()? (Exception handling)

    Release 5 of Perl added the END block, which can be used to simulate
    atexit(). Each package's END block is called when the program or thread
    ends (see perlmod manpage for more details).
Since Perl 5 is so old, I suggest it's not worth mentioning when this
was added.  The END block is just a feature of Perl.

I'm not even sure what the point of the question is. END blocks aren't
good for exception handling because you're not really handling
anything; you're just getting ready to stop.

END{} though could be viewed as exception handling
in the sense of enabling code insertion before
terminating if the program die()'s.


--
Charles DeRykus

.