From: Erik Veenstra Date: 2006-06-29T05:14:19+09:00 Subject: Re: while modifiers have a scoping bug?! > puts(line) while line = gets > > The Pickaxe says on page 354 that unless the expression (on > the left of the while) is not a block, then the loop gets > executed ZERO or more times. So it has to evaluate the > condition BEFORE the expression, which ought to assign a > value to "line" (thus defining it). Lexically, "puts line" comes first. Although "while line = gets" is executed first and it does set /a/ (not /the/) line, it's not yet available for "puts". > line = nil > puts(line) while line = gets Now it's the same "line"... gegroet, Erik V. - http://www.erikveen.dds.nl/