From: mzhang.cn@... Date: 2005-11-10T17:12:13+09:00 Subject: Newbie question: About class variable and class_eval Hi all, Please look at the following code ----------------------------------------------------------- class Cls @@cv = 0 def initialize @iv = 1 end end c=Cls.new Cls.class_eval { def iv() @iv end } puts c.iv Cls.class_eval { def cv() @@cv end } puts c.cv ------------------------------------------------------------- When running this code snippet, I got the result: $ ruby classvar.rb 1 classvar.rb:11:in `cv': uninitialized class variable @@cv in Object (NameError). Why I can't get the class variable in class_eval?