my $foo = { hash => 'ref' }; my $bar = { hash => 'ref' }; some_sub($foo); $foo == $bar ...; # should now be true! sub some_sub { my $ref = shift; $ref = $bar; # except in Perl this just copies over # lexical $ref, not $foo! }