From: "Damián M. González" Date: 2012-12-28T23:20:51+09:00 Subject: Re: Case statement anomaly? > Carlos, where is this information (about 'when' not accepting a block) > on the 'Net, please? I'm afraid I couldn't find it, although I looked > at ruby-lang.org and several other places. Well you have to think out that every code inside "when" and the next "when" ;or between "when" and "else";or between "when" and "end";or between "else" and "end" is a chunk of code, so is like a block, you don't need to put the code inside "do .. end" or {}. It is not necesary, of course you can use blocks inside for example: a = 1 b = ["one", "two"] case a when 0 b.each do │number│ number.capitalize! end else begin a.length rescue => e puts "The error is #{e}" end end This will finish with an error, and I maked that with the purpose to show in which case you can use "begin .. end", if you don't want to rescue nothing is not necesary use "begin .. end", just put the chunk of code. Well hope this help you, see ya' :) -- Posted via http://www.ruby-forum.com/.