From: botp Date: 2011-04-13T12:05:05+09:00 Subject: Re: hash of arrays On Wed, Apr 13, 2011 at 9:06 AM, David Sprague wrote: > dict = Hash.new([]) > > dict_file.each do |line| >  line.chomp!() >  dict[line.length] << line > end there are many ways. one way eg, dict={} dict_file.each do |line| line.chomp! (dict[line.length] ||= []) << line end best regards -botp