From: Bill Guindon Date: 2006-06-01T08:43:01+09:00 Subject: Re: Better coding using ruby On 5/31/06, Paul D. Kraus wrote: > > Itterating over an array and then having to have a counter variable to make > "in-place" changes seems a little overkill and I am pretty certian there is > probaly a better way. %w[a b c d e].each_with_index do |val,idx| puts "#{idx} = #{val}" end 0 = a 1 = b 2 = c 3 = d 4 = e -- Bill Guindon (aka aGorilla) The best answer to most questions is "it depends".