in reply to Opinions of Error.pm

Matt Sargeant has a pdf somewhere. The upshot is not to use Error.pm. Do use Exception::Class Do use Fatal.pm Do use $SIG::{__DIE__}

Replies are listed 'Best First'.
Re^2: Opinions of Error.pm
by snowhare (Friar) on Sep 06, 2006 at 11:18 UTC

    Do NOT, however, use $SIG::{__DIE__} in anything you intend to distribute through CPAN.

    More than once I have wasted an hour or two tracking a bug that was having its error messages swallowed by a CPAN module that blithely used an unlocalized $SIG::{__DIE__} handler for its own error processing and did not propagate unknown errors. Thereby stomping all over my application's own error handling (and any other module that might need to 'die').

    It only takes one mis-use of $SIG::{__DIE__} anywhere in a body of code to mess it up for everyone. It is much too fragile for use in general release code.