#!/usr/local/bin/perl use strict; use warnings; use Scalar::Util qw/weaken/; { package Dummy; sub new { bless $_[1], $_[0] } sub DESTROY { warn "($_[0])" } } { my $mom = Dummy->new( {} ); my $son = Dummy->new( {} ); $mom->{son} = $son; weaken $mom->{son}; $son->{mom} = $mom; weaken $son->{mom}; } warn "Goodbye, world!";