From: "Olivier D." Date: 2004-09-08T18:00:07+09:00 Subject: Re: Creating new scope On 2004-09-08, George Moschovitis wrote: > > x = 0 > > 1.times { > x = 1 > puts x > } > > puts x > > prints: > 1 > 0 If I do this on my machine, it prints 1 and 1. What version of Ruby have you installed? I have the version 1.8.1 and it works as advertised in the book "Programming Ruby" (chapter "The Ruby Language"): "If instead a variable of the same name is already established at the time the block executes, the block will inherit this variable." Your 1.times block inherits the x variable and modifies it (or maybe it's time for me to compile Ruby version 1.8.2?) -- Olivier D.