From: Jimi Damon Date: 2007-12-08T09:17:45+09:00 Subject: Re: Problem with Hash of Arrays How do you suggest creating new Hash entries where by default I want them to be Arrays ? In Perl I can easily ( albeit it is ugly ) type push ( @{$hash{key}}, "New value") This works as long as $hash{key} has either not been defined yet...or if it is already an anonymous Array. How can you use operators such as "Push" , or "<<" on a hash key/value pair when the key has not been defined yet for the hash ? I want a constructor for each "value" to make it an Array. PLease note, I don't want to write if hash.has_key?("key").nil? hash["key"] = ["new value"] else hash["key"].push( "new value" ) end Thanks for any suggestions and also for straightening me out about "Default" values. However, really what I am looking for is a default constructore for the blank value. -- Posted via http://www.ruby-forum.com/.