From: Damaris Fuentes Date: 2008-12-06T00:26:45+09:00 Subject: Array in a Hash Hi you all, I have the following code,where I have a hash whose entries are initalized by an empty Array: h = Hash.new(Array.new(0)) h["a"] << 0 h["b"] << 6 h["a"] << 5 h["b"] << 10 p h["a"] p h["b"] Both "p" prints the same: [0,6,5,10] What am I doing wrong? (I want h["a"] to be [0,5] and h["b"]=[6,10] -- Posted via http://www.ruby-forum.com/.