my $a = []; my $b = [ $a ]; push @$a, $b; # Now $b contains a reference to $a and # $a contains a reference to $b.