sub foo { for my $ref ($_[0]) { $ref = { all => new }; } } my $hash={}; print $hash,"\n"; foo($hash); print $hash,"\n";