From: Johan Holmberg Date: 2003-09-25T02:45:15+09:00 Subject: Re: Setting "variable" global variable ? On Thu, 25 Sep 2003, messju mohr wrote: > > or simply: > > def global_variable_set(name, val) > eval "$#{name} = val" > end > global_variable_set("foo", [1, 2, 3]) > > but the original question was how to do it *without* the eval. > I think it is quite "ok". At least there is no extra copying (or serialization) of "val" as in my original example. I didn't realize that the eval would "see" the value of "val", but apparently it does. But I'm still interested in a solution without "eval". Thanks for the answers soo far, /Johan Holmberg