From: Ankush Ganatra Date: 2011-12-06T13:54:12+09:00 Subject: Newbie: Understanding Throw/Catch --562430024-228568769-1323147248=:45010 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi=0A=A0=0AI was just going through various concepts fo Ruby and found one = interesting (but not so useful=A0in real world=A0) concept of Ruby, i.e. ca= tch and throw=0A=A0=0AI tried on of the example in the book.. =0A=A0=0Adef = dothings( aNum ) =0A=A0i =3D 0 =0A=A0while true =0A=A0=A0puts( "I'm doing t= hings..." )=A0 =0A=A0=A0throw( :go_for_tea ) if (i =3D=3D aNum )=A0=0A=A0en= d =0Aend =0Acatch( :go_for_tea ){ puts "caught here"}=0Adothings(0) =0A=0AT= he above code gives me=A0output as ::=0A=0Acaught here..=0Ai'm doing things= ... =0Athrow: uncaught throw 'go_for_tea' (Name Error)=0A=0A=0AI have 2 dou= bts here=0A=0A1.=A0Why is there an error at the end=0A2. Why "caught here" = is printed before the method is called?=0A=0A=A0=0A=A0=0AThanks. =0A=A0=0AR= egards=0A=0AAnkush --562430024-228568769-1323147248=:45010--