sub DESTROY { my ($self) = @_; my $id = ID($self); push @_, $id; DEMOLISH: for my $base_class (_hierarchy_of(ref $_[0])) { no strict 'refs'; if (my $demolish_ref = *{$base_class.'::DEMOLISH'}{CODE}) { &{$demolish_ref}; } for my $attr_ref ( @{$attribute{$base_class}} ) { delete $attr_ref->{ref}{$id}; } } }