http://www.perlmonks.org?node_id=1005703


in reply to What is the scope of $_?

To make things even more interesting, given creates a new lexical $_:

$ perl -wE '$_ = 1; sub p { say }; given (42) { say; p }' 42 1

Replies are listed 'Best First'.
Re^2: What is the scope of $_?
by Tanktalus (Canon) on Nov 26, 2012 at 17:53 UTC

    Interesting? More like buggy :-) Let's hope this gets fixed and given starts to become a bit more safe :-)