From: Sylvain Joyeux Date: 2007-06-12T15:49:34+09:00 Subject: Re: how to make a[2][2][3]=4 work? def recursive_hash Hash.new { |h, k| h[k] = recursive_hash } end a = recursive_hash Or even class Hash def self.recursive new { |h, k| h[k] = recursive } end end which gives >> a = Hash.recursive => >> a[1][2][3][4] = 1 => 1 >> puts a.inspect {1=>{2=>{3=>{4=>1}}}} -- Sylvain Joyeux