in reply to Re: lc entire contents of array?
in thread lc entire contents of array?
foreach $elem (@array) { $elem = lc $elem; }
Sadly readability (map/foreach) and efficient terse perlishness (the examples ending in for) are often not the same, and given the choice, I'd stick with the map. Yet, the foreach is much more flexible and readable in the long run, and is more readable for non-Perl folks as well. It may prove to be the best option in the long run, if not as shiny looking as the others.
|
|---|