From: ts Date: 2004-05-31T23:15:43+09:00 Subject: Re: variable -- set value >>>>> "o" == orbit writes: o> Whot can I set value for variable which name cosist ather variable? o> var1 = "@var2" Well, if you have the name of an instance variable you can use #instance_variable_{set,get} (with 1.8) to retrieve, or set, its value svg% cat b.rb #!/usr/bin/ruby class A def initialize(val) @a = val end end a = A.new(12) p a.instance_variable_get("@a") a.instance_variable_set("@a", 24) p a.instance_variable_get("@a") svg% svg% b.rb 12 24 svg% Guy Decoux