package Top; use Scalar::Util 'weaken'; sub new { my $class = shift; my $s = bless { }, $class; weaken($s); $s->{bottom} = Bottom->new( $s ); return $s; } #===================================== package Bottom; use Scalar::Util 'weaken'; sub new { my ($class, $top) = @_; my $s = bless { top => $top }, $class; weaken($s); return $s; } #===================================== package main; use strict; use warnings 'all'; my $top = Top->new(); my $bottom = $top->{bottom} or die "NO BOTTOM!";