From: Brian Candler Date: 2010-08-12T06:53:23+09:00 Subject: Re: syntax error, unexpected '}', expecting kEND > q.inject(Array.new(4,0)){ |h,e| if e < 10000 then h[Math.log10(e).to_i] > +=1 } "if" needs a matching "end", unless you use the postfix form: h[...] += 1 if e < 10000 BTW, even if you're using ruby 1.8.7, running ruby 1.9.x on your code with the -w flag can sometimes give better error messages. -- Posted via http://www.ruby-forum.com/.