sub DESTROY { my $self = shift; if ($created_objs{$self}) { # do my DESTROY stuff delete $created_objs{ $self }; } }