use Scalar::Util qw(weaken); use Devel::Peek; sub Container::DESTROY { warn "Container $_[0] is destroyed!"; } { my $container = bless {}, "Container"; Dump $container; my $button = bless { container => $container }, "Button"; push @{$container->{buttons}}, $button; Dump $container; weaken $button->{container}; Dump $container; } __END__