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
In Section
Seekers of Perl Wisdom
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