map returns a new list, whereas for allows modification of an existing one
It sounds like contracdicting although, perhaps, you didn't mean it. The
map operator allows modification as well since
$_ would be a
reference to the corresponding elements of existing array.
$ perl -wle 'my @ar = qw(one two three); print "@ar"; my @new = map {
+$_ = uc } @ar; print "@new"; print "@ar"'
one two three
ONE TWO THREE
ONE TWO THREE
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!