From: Brian Adkins Date: 2007-07-20T23:30:04+09:00 Subject: Re: Array : each_with_index On Jul 19, 3:12 am, Vin Raja wrote: > r = ['KLP','OGN' ] > msg =< Found #{r.length} orders > #{r.map.each_with_index{|v,i| puts "(#{i+1}) #{v}\n" }} > MSG > > puts msg It looks like others have already clarified things for you. This is a bit of a tangent, but I just wanted to mention that 'map' is superfluous in the above code i.e. the output is identical with and without it. irb(main):001:0> r = ['KLP','OGN' ] => ["KLP", "OGN"] irb(main):002:0> r => ["KLP", "OGN"] irb(main):003:0> r.map => ["KLP", "OGN"]