in reply to Throw from within a DESTROY block

It is by no means intended to describe my actual use case.

So when can we expect the rest of your question? We can't provide a workaround for something we know nothing about.

Replies are listed 'Best First'.
Re^2: Throw from within a DESTROY block
by ribasushi (Pilgrim) on Sep 07, 2011 at 05:56 UTC
    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.

      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.