From: nobu.nokada@... Date: 2003-02-07T11:56:56+09:00 Subject: Re: setting an instance variable Hi, At Fri, 7 Feb 2003 05:14:35 +0900, Chris Pine wrote: > If I have a string `str', is there a way to set an instance variable with > that name other than evaling a string? For example: No methods like Module#const_set for instance variables. > str = 'var_name' > val = ['string in an array'] > > eval "@#{str} = #{val}" # Is there another way to do this? Using `val' directly instead of #{val} would be better. -- Nobu Nakada