Nope, it happens because of the aliasing of the hash value inside grep, but I'm not sure how.
Interesting effect. I see your output with plain perl v5.22.2 (from 2016) on Linux x86-64 and with Strawberry v5.14.2 (from 2011) on Windows 64 bit. So this seems to be an old, unsolved problem.
Alexander
In reply to Re^3: unexpected modify hash in a distance with grep { $_ }
by afoken
in thread unexpected modify hash in a distance with grep { $_ }
by leszekdubiel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |