From: Philip Mak Date: 2002-06-03T07:49:34+09:00 Subject: $a = 5; $b = 'a'; print $$b Hello, I'm a seasoned Perl programmer trying to learn Ruby. Is there a way a variable name can be variable? Like, how would I rewrite the following piece of Perl code in Ruby: $a = 5; $b = 'a'; print $$b; # should print 5 And can this be done with instance variables? I'm trying to do this: class Series attr_accessor :sid, :handle, :name def initialize(vals) vals.each_key { |key| @(key) = vals[key] # This doesn't work; syntax error } end end s = Series.new({"sid" => 3, "handle" => "smoon", "name" => "Sailor Moon"}) puts s.name # should print "Sailor Moon"