From: Emeka Patrick Date: 2012-06-21T16:39:50+09:00 Subject: New to Ruby - Scope Question x = 10 y = 5 def square(x) puts "within the method x is " + x.to_s puts x*x end In the above when defining the method, the x that is being referenced in "x.to_s" and puts x*x is by default the variable x, defined above, with a value of 10, correct? This then means that even though this variable isn't defined within the method it can still be called on from outside the code. However, if the variable was given a value within the method then it wouldn't be available outside of the method, correct? Can someone explain why this is so. I guess I don't NEED to know why, but I'd like to understand it a bit better if possible. Thanks! -- Posted via http://www.ruby-forum.com/.