If you have 5.14.0 or higher, why not use s///r?
my @list = map { s/\r\n$//r } <$fh>; my @uc_list = map { uc s/\r\n$//r } <$lc_fh>; my @split_list = map {[ split m/\|/ => s/\r\n$//r ]} <$piped_fh>;
In reply to Re^2: Perl::Critic says don't modify $_ in list functions and other things
by Tux
in thread Perl::Critic says don't modify $_ in list functions and other things
by Lady_Aleena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |