From: Sylvain Joyeux Date: 2007-05-05T19:03:34+09:00 Subject: Re: Why do these two code blocks have different behavior? > def q1 > @@a.inject(0) {|sum, x| > pp x > return sum + x > } > end I'll add one thing to the other's explanations: 'next' does what you thought 'return' was doing: it terminates the block, returning the value given as argument def q1 @@a.inject(0) do |sum, x| pp x next sum + x end end will also work -- Sylvain Joyeux