From: Ian Whitlock Date: 2007-07-21T06:01:26+09:00 Subject: Re: Array : each_with_index Phrogz wrote: > puts "---scheme 4---" While I have found the thread fascinating, it appears to me that the original code and the 4 schemes are simply trying to avoid the definition of a function. def msg(r) puts "Found #{r.length} orders" r.each_with_index{|v,i| puts "(#{i+1}) #{v}\n" } end x = ['KLP','OGN'] msg(x) Can anyone explain what I am missing? Thanks Ian -- Posted via http://www.ruby-forum.com/.