From: Mister Rohit Date: 2007-09-18T23:29:25+09:00 Subject: scope questions ------=_Part_7886_28172112.1190125764679 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi guys, I am a recent Ruby convert (from PERL), and I am wondering if there is a way to get some of the behavior that I am comfortable with with regards to scope. In PERL the following code: my $var=1; { my $var=2; print "inner=$var\n" } print "outer=$var\n" yields: inner=2 outer=1 However in Ruby, I'm not sure how to get the same behavior. I tried: var=1 begin var=2 print "inner=#{var}\n" end print "outer=#{var}\n" which yields a different output than the PERL code. Is this type of thing possible in Ruby without creating a class? Thanks! -- "I'm not acting stupid" ------=_Part_7886_28172112.1190125764679--