[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: __DIE__ and exception hooks



Larry Wall <larry@wall.org> writes:
>Pete Jordan writes:
>: > Yes, we do need a module that can be subclassed from for throwing
>: > such exception objects (similar to Tie::Array et al).  The only
>: > question now is, are you willing to write it?
>: 
>: Yes, but... I'd like to integrate it with C<die> as I've described at
>: tedious length elsewhere, which make me fall foul of verboten
>: C<$SIG{__DIE__}> munging.
>
>I think you're assuming here that I wouldn't be interested in making
>all exceptions into objects.  I presume that's what you want the
>__DIE__ hook for.  I'd gladly turn all exceptions into objects in order
>to reduce the desire to __DIE__.

The only other thing I have been known to (ab)use __DIE__ for is to get 
the caller() chain from where die actually happened, back to the nearest
enclosing eval {}.

The problem being that if a Tk callback "dies" many call levels deep
you need to know where it died.

-- 
Nick Ing-Simmons


Follow-Ups from:
pete@horus.cix.co.uk (Pete Jordan)
References to:
Larry Wall <larry@wall.org>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]