From: dblack@... Date: 2003-09-25T05:00:55+09:00 Subject: Re: Setting "variable" global variable ? Hi -- On Thu, 25 Sep 2003, Hal Fulton wrote: > dblack@superlink.net wrote: > > > I don't want to be responsible for encouraging non-vigilance toward > > things like this... but if val is a string, wouldn't eval'ing val > > just result in the string, not a further evaluation of the string? > > > > a = "puts 'hi'" > > eval "b = a" > > > > b is now "puts 'hi'", but 'hi' doesn't get puts'd. > > > > (Or is there another, more evil scenario I'm not thinking of?) > > I was thinking of something like > > set_global_variable(name,666) > > where name is given a value like '1 + `someprog`; $foo' which would > effectively result in: > > eval("$1 + `someprog`; $foo = 666") I realized this (that you meant name, not val) about halfway between my office and class :-) David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav