* Ara.T.Howard / noaa.gov wrote:

> On Fri, 3 Jun 2005, Oliver Cromm wrote:
> 
>> But how can I set "the attribute whose name is in the variable *key*"?
> 
> key = 'foo'
> 
> value = open_struct.send 'foo'
> 
> open_struct.send "#{ foo }=", value
> 
> hth.

A mathematics professor once told me that textbooks should contain
enough errors, so that students would have to spot them, and not get
lazy. 
So, yes, after changing the obvious error, the above works fine, thanks.

  open_struct.send "#{ key }=", value
-- 
A computer will do what you tell it to do, but that may be much
different from what you had in mind. - Joseph Weizenbaum