From: Olivier Renaud Date: 2007-03-26T05:28:42+09:00 Subject: Re: splitting an array into sub_arrays ...need advice Note that partition_by is a simple method with no dependencies. So, you can just copy/paste this method in your code from facets.rubyforge.org online documentation. Here it is : module Enumerable def partition_by r = Hash.new{ |h,k| h[k]=[] } each do |e| r[ yield(e) ] << e end return r end end And then : require 'enumerator' start_array.partition_by {|ary| ary[1..2]}.to_enum(:each_value).to_a -- Olivier Renaud