I was trying to make my example code as side-effect free as possible
Using $_ doesn't mean your code is side-effect free, just that the side-effects are implicit. This is the reason you should use $_ with caution. It can be a nice way to increase clarity, but as your question ably demonstrates, can often introduce much confusion.
In reply to Re^3: $_, one lexical scope removed
by revdiablo
in thread $_, one lexical scope removed
by sleepingsquirrel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |