In my opinion, $_ springs into being when Perl feels it's appropriate -- it's an auto-vivified rvalue.
On the other hand, $_ is *never* an lvalue unless you're using a regexp to modify the value, as in $_ =~ s/foo/bar/;, and even that's stretching a point, because of course uou can do the same thing with just s/foo/bar/;
So I would say that any code that *sets* $_ is, by definition, wrong.
In reply to Re: "$_" vs. $_
by talexb
in thread "$_" vs. $_
by argv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |