in reply to Re^2: Conditional DESTROY
in thread Conditional DESTROY

To track this down better, maybe you can dump the object(s) in question at strategic places of the lifetime of your program. Maybe you get lucky and find that no_DESTROY gets reset/lost somewhere or a place where another object holds on too long to the object in question.

Note that closures are notorious for holding on surprisingly long to objects:

sub make_frobnitzer { my( $self )= @_; $self->{on_error}= sub { $self->error_on_frobnitz( @_ ); } }

In the above case, $self will live until global destruction, because the on_error subroutine closes over $self.

Replies are listed 'Best First'.
Re^4: Conditional DESTROY
by Ralesk (Pilgrim) on Jun 10, 2013 at 10:54 UTC

    It was PEBKAC, the thing works as expected — I explained to BrowserUk below how I managed to mess things up.

    But thanks for your help :)