From: Brian Candler Date: 2010-06-03T00:29:43+09:00 Subject: Re: documentation mismatch ? Stanislav Orlenko wrote: > x = 10 > 5.times do |x| > puts "x inside the block: #{x}" > end In ruby 1.9, the |x| block parameter is different to the x variable declared outside. You'll also get a warning if you use the -w flag. $ ruby19 -w try.rb try.rb:2: warning: shadowing outer local variable - x x inside the block: 0 x inside the block: 1 x inside the block: 2 x inside the block: 3 x inside the block: 4 x outside the block: 10 -- Posted via http://www.ruby-forum.com/.