From: Adam Groves Date: 2008-02-12T17:29:26+09:00 Subject: Re: nested hash from array of paths Gavin Kistner wrote: > On Feb 11, 10:00�pm, Phrogz wrote: >> array.each{ |path| >> � sub = auto_hash >> � path.split( "/" ).each{ |dir| sub[dir]; sub = sub[dir] } >> } > > Bah, of course that can be written as: > > array.each{ |path| > sub = auto_hash > path.split( "/" ).each{ |dir| sub = sub[dir] } > } Gavin, thanks mate - works a charm. I'm glad you spotted my deliberately inconsistent output as well! ;) Adam -- Posted via http://www.ruby-forum.com/.