sub foo { my $ref = shift; # I expect this change to be visible outside of foo(). $ref = { all => new }; } #### sub foo { my $ref = shift; # Modified value is now visible outside of foo() $ref->{all} = 'new'; }