From: Martin DeMello Date: 2003-05-30T07:04:37+09:00 Subject: Re: Iteration - last detection dblack@superlink.net wrote: > Let Ruby do more of the work for you :-) > > module Enumerable > def each_with_last > each_with_index {|e,i| yield(e, i == size-1)} > end > end You aren't guaranteed 'size', though. martin