From: Marnen Laibow-Koser Date: 2010-02-05T11:20:26+09:00 Subject: Re: Can Ruby Do This? Mr Bubb wrote: > In Perl, you can create a hash of arbitrary depth like so: > > $hash->{foo}->{bar}->{baz} = 123; > > I've tried this in ruby: > > hash[:foo][:bar][:baz] = 123 > > but I get nil.= errors > > I could of course do a check for null at each level, but oy, that's so > cumbersome. Is there a ruby way? Sure, but there's probably also a better way that doesn't involve so much Hash nesting. Can you explain what you're using this for? > > Thanks! Best, --  Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org -- Posted via http://www.ruby-forum.com/.