Keep It Simple, Stupid | |
PerlMonks |
Re: Perl::Critic says don't modify $_ in list functions and other thingsby choroba (Cardinal) |
on Jul 09, 2020 at 05:37 UTC ( [id://11119065]=note: print w/replies, xml ) | Need Help?? |
Sometimes, no loop is needed at all:
When using readline, it's probably not so serious, as you aren't changing the original array in place at the same time. The /r is useful when you want to keep the original:
When you want to modify the original array, use "for" instead.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|