in reply to Best Practices for Exception Handling
Another way of treating an error or warning as an event (which I have only learned a while ago and found useful) is to define handlers for it using:
local $SIG{__WARN__} = \&HandlerSub; local $SIG{__DIE__} = \&OtherHandler;
But the problem with it is that you really must pay attention to your use of warn and die, as well as conditions when something not written by you might die.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Best Practices for Exception Handling
by adrianh (Chancellor) on Jul 11, 2003 at 18:24 UTC |
In Section
Seekers of Perl Wisdom