On Tue, Apr 03, 2007 at 12:00:09PM +0900, Mike wrote:
>    How could I know that current iteration is the last in the series?
>    For example:
> 
> [1, 2, 3, 4, 5, 3, 4].each do |element|
>    print element.to_s
>    print ',' if !LAST
> end

Try thread around
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/72518
for some sample implementations.