From: "Stathy G. Touloumis" Date: 2002-10-03T03:22:36+09:00 Subject: Re: bugs > >> k='Hello' > >> [1,2,3].map {|k| k} > >> puts k > >> > >> It prints 3 under ruby1! > > > >Yes, using block argument equals to assignment to it. > >But shouldn't it be local to the block? It may cause nice errors... >If it is available outside the block, it is a Bad Idea(tm). This is an issue discussed previously on this list as well as feature enhancements to Ruby in future versions if I am not mistaken. In the above code k is defined outside the code block and that is why it's assignment within the code block is retained outside of it.