Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!vlsi-mentor!dave From: dave@vlsi-mentor.jpl.nasa.gov (David Hayes) Newsgroups: comp.lang.perl Subject: Re: Help a perl apprentice Message-ID: <1990Oct25.063526.1571@vlsi-mentor.jpl.nasa.gov> Date: 25 Oct 90 06:35:26 GMT References: <18840001@hp-lsd.COS.HP.COM> <10080@jpl-devvax.JPL.NASA.GOV> Organization: Jet Propulsion Laboratory (NASA), Pasadena CA Lines: 25 lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: >In general, use of index variables (such as $i) is a warning sign that >there's a better way to do it in Perl. Really? Please enlighten me.... I want to process an array of stuff @stuff. Lets say that I want to do a "tolower" on each element of stuff (an array of text strings). The current way I do this is (yes I am a C programmer to the core): for($i=0; $i<$#stuff; $i++) { $stuff[$i] =~ tr/A-Z/a-z/; } Is there a better way? ---- Dave Hayes dave@vlsi-mentor.jpl.nasa.gov {ucbvax,ames}!elroy!vlsi-mentor!dave "Attempt to find truth by realizing that it will generally find YOU." -- ---- Dave Hayes dave@vlsi-mentor.jpl.nasa.gov {ucbvax,ames}!elroy!vlsi-mentor!dave "Attempt to find truth by realizing that it will generally find YOU."