Alexander Bokovoy wrote:
>>Another one:
>>
>>def a
>>  b=2
>>end
>>
>>a()
>>puts b
>>
>>prints 2
> 
> Also correct.
> Remember that variables in Ruby has no 'local' context.

Ruby most certainly does have a 'local' context. The variable 'b' should 
be local to the method 'a'.

When I tested this, I got an error similar to that of Nobu Nakada's:
-:6: undefined local variable or method 'b' for #<Object:0x2a79360> 
(NameError)

Using 'ruby 1.7.2 (2002-07-02) [i386-mswin32]' on Windows 2000.

Cheers,

bs.