From: AD60 Date: 2009-03-01T06:18:58+09:00 Subject: Newbie question > Hash workings Hi, I am puzzled by the workings a the following program. I placed the output after the corresponding lines. To me it lookes like a sort of bug in the workings of de p method. Can anybody set me straight? h = Hash.new([]) h[0] = [1,2,3] p h #> {0=>[1, 2, 3]} h[0] += [4] p h #> {0=>[1, 2, 3, 4]} h[1] += [10,11] p h #> {0=>[1, 2, 3, 4], 1=>[10, 11]} h[1] << 12 p h #> {0=>[1, 2, 3, 4], 1=>[10, 11, 12]} h[2] << 20 p h #> {0=>[1, 2, 3, 4], 1=>[10, 11, 12] ? p h[2] #> [20] ??? h[2] << 21 p h #> {0=>[1, 2, 3, 4], 1=>[10, 11, 12]} ? h[2] += [22] p h #> {0=>[1, 2, 3, 4], 1=>[10, 11, 12], 2=>[20, 21, 22]} ???????? Grtz. André