in reply to Re: What is the scope of $_?
in thread What is the scope of $_?
<tangent> How is @_ not global in scope? I mean, it gets implicitly localized on any subroutine call, but it's present by default and package independent:
</tangent>use strict; use warnings; @_ = @ARGV; package Foo; print for @_; @_ = qw(1 2 3 4 5); { local @_ = reverse @_; print for @_; } package main; print for @_;
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In Section
Seekers of Perl Wisdom