in reply to lc entire contents of array?

since perldoc -f lc says nothting about lc LIST there is the only way exists $_ = lc foreach @array

Update: @array = map{lc} @array is much more readable form of this translation

Replies are listed 'Best First'.
Re: Re: lc entire contents of array?
by flyingmoose (Priest) on Mar 30, 2004 at 18:12 UTC
    If you want the more efficient approach of for/foreach (which uses aliasing) with the readability of map, don't use the short form of for! This is about as good as map and still looks clean.

    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.