From: 7stud -- Date: 2007-09-03T10:54:17+09:00 Subject: assigning to hash keys when there is a default value? Can someone explain why there is a difference in the second line of output for the two hashes: h = Hash.new(5) puts h[2] h[2] ||= 10 p h #---------- puts #---------- h = Hash.new puts h[2] h[2] ||= 10 p h ---output:-- 5 {} nil {2=>10} -- Posted via http://www.ruby-forum.com/.