in reply to Re: Perl::Critic says don't modify $_ in list functions and other things
in thread Perl::Critic says don't modify $_ in list functions and other things
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.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Perl::Critic says don't modify $_ in list functions and other things
by jcb (Parson) on Jul 10, 2020 at 23:40 UTC | |
by haukex (Archbishop) on Jul 11, 2020 at 06:18 UTC | |
by jcb (Parson) on Jul 12, 2020 at 03:20 UTC | |
by haukex (Archbishop) on Jul 12, 2020 at 05:58 UTC |
In Section
Seekers of Perl Wisdom