in reply to Re: Throw from within a DESTROY block
in thread Throw from within a DESTROY block

There is no rest. The question is:

How do I massage perl (with a trick, with XS, whatever) to throw a real (as in eval-trappable) exception from within some DESTROY of some object being destroyed.

  • Comment on Re^2: Throw from within a DESTROY block

Replies are listed 'Best First'.
Re^3: Throw from within a DESTROY block
by ikegami (Patriarch) on Sep 07, 2011 at 20:41 UTC

    Using die. The catch is that Perl's calls DESTROY inside of an eval (effectively) so it doesn't go far.

    If you want to throw something catchable outside of DESTROY, it'll have to be thrown from outside of DESTROY.