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