From: Harry Ohlsen Date: 2001-12-13T00:04:48+09:00 Subject: [ruby-talk:28347] Re: Reviews solicited for Ruby article In article <005801c18307$0fab2a50$eaa0a118@credenza>, "Bill Kelly" wrote: > > counts = Hash.new(0) > text.scan(/[A-Z]/).each {|c| counts[c] += 1} The only problem with this is that I'm pretty sure that I was unable to do the += unless counts[c] already existed (which makes sense, since otherwise it's nil). That makes the code messier, because you need a test. Am I wrong? If not, can you see a neat way to get it to work, without using the test?