in reply to Modifying values by reference: what works and what doesn't

Since nobody else mentioned it, there's a key difference between your two code snippets. In your first, you appeared to be interested in making the caller's hash empty except for one key/value pair. Of course, you see now why that attempt failed in modifying the caller's hash at all. In your second, you simply added or replaced a single key/value pair, and left any other contents of the caller's hash alone.
sub foo { my $ref = shift; %$ref = ( all => new ); }
This alternative will keep the caller's hash intact, but replace ALL of its contents with a completely new set of contents, consisting of one key/value pair. This will also work even if the caller's hash is actually a blessed reference; the existing blessing is not broken (desecrated?) by this method.

--
[ e d @ h a l l e y . c c ]