Welcome to the Monastery | |
PerlMonks |
Implementing the counterpart of BEGINby punkish (Priest) |
on Feb 03, 2005 at 15:16 UTC ( [id://427664]=perlquestion: print w/replies, xml ) | Need Help?? |
punkish has asked for the wisdom of the Perl Monks concerning the following question:
elsewhere I learned that putting a BEGIN block in my script
prints out to the file ?.err any errors or warnings that the script migh encounter during compile time. My question is -- is there a way to implement a corresponding FINISH block (as opposed to __END__) which will trap any errors in case the script comes to a dead halt? Now, I can use the die statement whenever something goes wrong, but that can't really trap things like Control-breaks or control-c etc. How do I trap SIGTERM so that the reason for SIGTERM is written out to ?.err as well? Update: I should mention -- I need to do this on Windows. Considered by dragonchild - Retitle to "How do I trap signals on Win32"
Back to
Seekers of Perl Wisdom
|
|