From: Douglas Livingstone Date: 2006-05-23T05:55:29+09:00 Subject: Re: Creating Hash of Arrays 2006/5/22, Paul D. Kraus : > > > > > > h = Hash.new { |hash, key| hash[key] = Array.new } > > > Newbie here but what exactly does this like do. > Can you someone break it down for me thanks. > From the docs: http://www.ruby-doc.org/core/classes/Hash.html#M000886 If you try and get the value using a hash key which does not exist, then the value of the block when called with the hash and the new key will be returned instead. Douglas