From: "Iñaki Baz Castillo" Date: 2008-04-16T16:57:47+09:00 Subject: Re: Annoying block variable behaviour !! 2008/4/16, Peña, Botp : > the ruby community is divided when it comes to this shadowing behaviour of block locals and block params. see the ruby archives. Thanks, I'll look for it. > on your case, ruby1.9 may satisfy > > irb(main):005:0* RUBY_VERSION > => "1.9.0" > irb(main):006:0> [1,2,3,4].each { |kk| kk=true } > => [1, 2, 3, 4] > irb(main):007:0> kk > > NameError: undefined local variable or method `kk' for main:Object > > > irb(main):008:0> kk=false > => false > irb(main):009:0> [1,2,3,4].each { |kk| kk=true } > => [1, 2, 3, 4] > irb(main):010:0> kk > => false > > and it comes w warnings too just in case you want to be safe ;) Great to know it, thanks a lot :) -- Iñaki Baz Castillo