From: Chris Pine Date: 2003-02-07T05:14:35+09:00 Subject: setting an instance variable Silly question: 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: str = 'var_name' val = ['string in an array'] eval "@#{str} = #{val}" # Is there another way to do this? p @var_name # --> ['string in an array'] Just curious if it's possible, Chris