From: Jacob Fugal Date: 2007-01-06T01:55:11+09:00 Subject: Re: case when... On 1/5/07, Josselin wrote: > >> case 'a' > >> when 'a1' > >> puts.. > >> puts ... > >> return > >> when 'a2' > >> puts ... > >> puts ... > >> puts ... > >> return > >> when 'a3' then puts ... > >> else > >> puts ... > >> puts ... > >> end > > a return was missing to close the latest 'else'.... Huh? You don't need returns to "close" the when's or else. Unlike C, there's no "trickle" effect to Ruby case statements, one a branch has been matched, only that branch is executed. There's no need for "break" or "return" or anything like that. Jacob Fugal