From: Ferenc Engard Date: 2002-04-21T04:11:21+09:00 Subject: a newbie about local variables Hi there, First of all, I greet everybody on the list as this is my first post here. I am just getting to know ruby, and trying to understand variable scopes and general encapsulation/hiding mechanisms. (I am also learning C++ at the same time... :) So, as I understand I can use all the local variables in do .. end blocks, 'while', 'until', and 'for' loops which are defined outside of these structures. Why cannot I override this, to ensure that a new local variable I want to use in the block _must_ be local, even if there is a same var in the outer scope (like in C++, or (AFAIK) in perl with 'my' cmd)? And only for the do .. end blocks: can I use them anywhere in my code just to keep my variables' scope as small as it is possible? Thank you, and sorry if I asked something stupid: Circum