my $x = []; my $y = []; if ($x == $y) { print "x and y are the same reference\n" } $y = $x; if ($x == $y) { print "x and x are the same reference\n" }