From: Daniel DeLorme Date: 2008-10-02T13:41:01+09:00 Subject: Re: ruby1.9 block scope Joe W�lfel wrote: > > On 1 oct. 08, at 04:18, Brian Candler wrote: >> >> def my_find(a) >> # res=nil not needed! >> a.each { |e| res = e if e =~ /foo/ } >> res >> end > > res = a.find { |e| e =~ /foo/ } Actually that has a slightly different effect. Brian's my_find finds the *last* matching expression. ;-)