From: Michael Neumann Date: 2004-08-10T18:43:13+09:00 Subject: Re: FirstEachLast, an extension to the Enumerable module. Michael Neumann wrote: > I know, you could also use each_with_index instead (this one exists!): > > blah.each_with_index {|element, inx| > if inx == 0 > # first > elsif inx < blah.size should be: elsif inx < blah.size - 1 > # inside > else > # last > end > } >