the $_ inside the grep is an alias of the hash-values, i.e. any assignment would be mirrored. For reasons that I don't understand yet (under-coffeination perhaps) this triggers an autovivification.
My educated guess is that it's because autovivification generally happens in an lvalue context.
In reply to Re^2: unexpected modify hash in a distance with grep { $_ }
by haukex
in thread unexpected modify hash in a distance with grep { $_ }
by leszekdubiel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |