sub foo { my $ref = shift; # Modified value is now visible outside of foo() $ref->{all} = 'new'; }