From: Dave Thomas Date: 2000-12-08T04:43:12+09:00 Subject: [ruby-talk:6911] Re: array of hashes "Joseph McDonald" writes: > How do you declare an array of hashes? You can't declare it directly. Instead, you allocate the hashes as you go along, or pre-allocate them if you know how big the array will be: SIZE = 100 a = Array.new(SIZE) SIZE.times { |i| a[i] = Hash.new } --or-- a = [] # then later a[i] ||= Hash.new a[i]['joe'] = ... There's a rumor that the next version of Ruby will feature active defaults, allowing you to do this kind of thing automatically. Regards Dave