![]() |
|
Syntactic Confectionery Delight | |
PerlMonks |
How can I do an atexit() or setjmp()/longjmp()? (Exception handling)by faq_monk (Initiate) |
on Oct 08, 1999 at 00:29 UTC ( [id://723]=perlfaq nodetype: print w/replies, xml ) | Need Help?? |
Current Perl documentation can be found at perldoc.perl.org. Here is our local, out-dated (pre-5.6) version:
Release 5 of Perl added the
END block, which can be used to simulate
For example, you can use this to make sure your filter program managed to finish its output without filling up the disk:
END { close(STDOUT) || die "stdout close failed: $!"; } The END block isn't called when untrapped signals kill the program, though, so if you use END blocks you should also use
use sigtrap qw(die normal-signals);
Perl's exception-handling mechanism is its
If exception handling is all you're interested in, try the exceptions.pl library (part of the standard perl distribution).
If you want the
|
|