use strict; use warnings; require Data::Dumper; my $foo = { # blessed one => 1, two => 2, six => 6, }; bless $foo, q{Number::3ch}; my $bar = { # not blessed one => 1, two => 2, six => 6, }; sub foo { # pass by ref my $ref = shift; $ref->{one} = q{One}; $ref = {}; # why won't this replace the underlying hash? return $ref; } # try on blessed reference print Data::Dumper::Dumper($foo); foo $foo; print Data::Dumper::Dumper($foo); # try on unblessed reference print Data::Dumper::Dumper($bar); foo $bar; print Data::Dumper::Dumper($bar);