From: matz@... (Yukihiro Matsumoto) Date: 2001-03-29T15:54:33+09:00 Subject: [ruby-talk:13312] Re: hash values can't change?? Hi, In message "[ruby-talk:13311] hash values can't change??" on 01/03/29, mjbjr@beaudesign.com writes: |According to the ProgrammingRuby docs, a hash value can't change. |Why is this? You can't modify the key objects. But you can change the associated values. For example freq = Hash.new(0) while gets() for word in $_.split(/\W+/) freq[word] += 1 end end for word in freq.keys.sort! print word, " -- ", freq[word], "\n" end matz.