Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Global SIG handler: Is this advisable? Is there a better way?by snafu (Chaplain) |
on Aug 29, 2006 at 17:04 UTC ( [id://570210]=perlquestion: print w/replies, xml ) | Need Help?? |
snafu has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing code that is fork()able and within that code I want to be able to catch and log all signals whether or not they kill the code (of course, not TERM). So, after trying a few options (including $SIG{__DIE__} and END{};) I came up with the following code which does what I want it to do. What I'm curious about is whether or not there is anything wrong with this pragma and if there is a better(tm) way to do it.
I did a search and found some ideas using Carp and eval()'s but felt that since this program is already 99.9% done being written, it's on a deadline, and it's working quite well that this would be an acceptable way of getting what I want. TIA
_
_
_
_
_
_
_
_
_
_
Back to
Seekers of Perl Wisdom
|
|