use v5.14; package Mouth { use Moo; has teeth => (is => 'ro'); sub DESTROY { say 'Mouth->DESTROY' } } package Head { use Moo; has mouth => (is => 'ro'); sub DESTROY { say 'Head->DESTROY' } } my $mouth = Mouth->new(teeth => []); my $head = Head->new(mouth => $mouth); say 'undefining $mouth'; # Note: DESTROY not called, because $head still refers to $mouth undef $mouth; say 'undefining $head'; # Now both DESTROY methods will be called undef $head; #### use v5.14; package Mouth { use Moo; has teeth => (is => 'ro'); sub DESTROY { say 'Mouth->DESTROY' } } package ZombieHead { use Moo; has mouth => (is => 'ro', weak_ref => 1); sub DESTROY { say 'Head->DESTROY' } } my $mouth = Mouth->new(teeth => []); my $head = ZombieHead->new(mouth => $mouth); say 'undefining $mouth'; undef $mouth; # DESTROY is called!! say 'undefining $head'; undef $head;