MeowChow has asked for the wisdom of the Perl Monks concerning the following question:
Or, which would you rather see in code you're maintaining:
Or...$_ = 'hi' for @list[map {$_ * 2} 0..$#list/2];
Does the first loop go "too far" down the path of idiomatic perl? Does the second loop give you nasty C flashbacks? Assuming efficiency is not a major concern, did I leave out a more elegant solution?for (my $i = 0; $i <= $#list; $i += 2) { $list[$i] = 'hi'; }
MeowChow s aamecha.s a..a\u$&owag.print
Back to
Seekers of Perl Wisdom