From: Phil Mitchell Date: 2001-09-27T21:32:15+09:00 Subject: [ruby-talk:21767] Re: scope in {} and do-end Try: a=[1] for obj in a x = 5 end puts x On Thu, 27 Sep 2001 02:09:40 +0900, "Hal E. Fulton" wrote: > Question... > > I thought that braces introduced a new scope > but do-end didn't. > > Has this changed? Was it ever the case? > > Both these fragments tell me x is undefined. > > a=[1] > a.each { x = 5 } > puts x > > a=[1] > a.each do x = 5 end > puts x > > > Thanks, > Hal > > >