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

.



Relevant Pages

  • Re: Windows version of Biber .5
    ...    but there is no README.txt in that .zip. ... Ubuntu but not on Windows. ... Choose the link that corresponds to your version of Perl ... users don't have to install perl and all the various dependencies. ...
    (comp.text.tex)
  • Re: Help me to Improve
    ... I can give you *lots* of examples where Perl ... that's a reason for not putting it in the language at all, ... with a 'sub method' in the current package. ...     sub logger { ...
    (comp.lang.perl.misc)
  • Re: Windows version of Biber .5
    ... don't do anything with Perl, so it seems kind of excessive to install ... I do have perl installed (ActivePerl on Windows XP), ... I still can't install biber. ...    but there is no README.txt in that .zip. ...
    (comp.text.tex)
  • Re: Windows version of Biber .5
    ...    but there is no README.txt in that .zip. ... Ubuntu but not on Windows. ... Choose the link that corresponds to your version of Perl ... Still, the installation oif biber ...
    (comp.text.tex)
  • Re: __DATA__ and in Forth
    ... I did not realise that perl was working one line at a time, ... would have to be caught and used to compile the count and end of the ... interpretation is then available to the program. ...     begin ...
    (comp.lang.forth)