On Sun, Jul 17, 2011 at 5:03 PM, jake kaiden <jakekaiden / yahoo.com> wrote:
> i was indeed missing something obvious - thanks for pointing it out!
> somehow i overlooked that Array#index was always going to return the
> first occurrence even if it was within an iteration...
>
>     

Have you been referred to #each_with_index already?

array.each{|entry, index|
 p index if entry == "out"
}

This is more efficient also since #index has to search the Array from
the beginning.

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/