From: Martin DeMello Date: 2007-04-29T03:18:32+09:00 Subject: Re: Output A File w/ Line Numbers? On 4/28/07, John Joyce wrote: > > > So let me see if I got this close to straight: > each_with_index is like each in that it alows you to iterate through > the array, but additionally hands over a counter that is also > incremented?! If this is the deal, then I'm gonna have to go to rehab > because of that method. How useful it will be. I think for the last > week I've been wanting exactly that in more places than I can think > of. Where I had been building iterating blocks with some externally > initialized counter. I knew I'd missed something golden. Hadn't > looked into the Enumerator lib yet. Been forging through the File an > IO stuff. Wait till you feel the need for map_with_index :) martin