stefp has asked for the wisdom of the Perl Monks concerning the following question:

I want to override die wholesale. I do use Carp 'confess';
*CORE::GLOBAL::die = \&confess; sub test { &test unless $a++ == 5; die "hard" } test it behaves like a normal die Help!

Replies are listed 'Best First'.
Re: a papist want to confess
by btrott (Parson) on Sep 10, 2000 at 23:18 UTC
    You can use $SIG{__DIE__}. There are some "issues" with setting $SIG{__DIE__} when using eval, so be careful. You can read more here.
    local $SIG{__DIE__} = \&confess;
    If you'd rather override CORE::GLOBAL::die, you need to do so from a different package. Take a look at Overriding the Core die Function. This is from the mod_perl guide, but it should apply to your situation, as well.
      The later should do. Thanks
Re: a papist want to confess
by Anonymous Monk on Sep 10, 2000 at 23:47 UTC
    I should have done:

    BEGIN { *CORE::GLOBAL::die = \&confess }

    The overloading happened too late (at run-time) in my code.Thanks people for helping.