subs using $_ should localize *_, which replaces the entire glob
Since this only about $_, then local $_; is better, because localizing @_ is unlikely to be in the sub's interest. (Update: Except on Perl versions before 5.14, as per the replies.)
In reply to Re^2: Perl::Critic says don't modify $_ in list functions and other things
by haukex
in thread Perl::Critic says don't modify $_ in list functions and other things
by Lady_Aleena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |