Hi,

From: "Albert Vernon Smith" <smithav / cshl.edu>
> 
> On 10.4.2006, at 14:05, James Edward Gray II wrote:
> 
>> Can you show an example using Perl's auto-vivification that feels  
>> funny in Ruby?  Perhaps we would have better ideas after seeing it...
> 
> Didn't feel funny, I just wasn't use to having to declare objects  
> (hashes and arrays) as I added them as branches on my initial hash.   
> I had to use a little more discipline, which probably is a good thing  
> coming from Perl-land.

Incidentally, if you ever need an auto-vivifying hash-of-hashes
(as opposed to mixture of hashes and arrays that is possible
because of Perl syntax), you can do the hash-of-hashes
auto-vivify in Ruby:

HashFactory = lambda { Hash.new {|h,k| h[k] = HashFactory.call} }

irb(main):181:0> x = HashFactory.call
=> {}
irb(main):182:0> x['abc']['def']['ghi'] = 123
=> 123
irb(main):183:0> x
=> {"abc"=>{"def"=>{"ghi"=>123}}}


Regards,

Bill