From: "Morris, Chris" Date: 2002-03-28T22:17:49+09:00 Subject: .send for global vars? I posted this at the end of the "Variable variables in Ruby?" thread, so in case it didn't get much attention there, I'm reposting to see if I can get an answer. I know how to use send on a class instance: irb(main):017:0> class Test irb(main):018:1> attr_accessor :a irb(main):019:1> end nil irb(main):020:0> t = Test.new # irb(main):021:0> t.send("a") nil irb(main):022:0> t.a = [] [] irb(main):023:0> t.send("a") [] irb(main):024:0> ... but what do I send the message to for a global var?: irb(main):002:0> $_foobar = "test" "test" irb(main):003:0> x = "foobar" "foobar" irb(main):008:0> send("$_" + x) NameError: undefined method `$_foobar' for # from (irb):8:in `send' from (irb):8 ... who 'owns' the global var? Chris Morris chris.morris@snelling.com