From: Marc Rene Arns Date: 2002-05-31T07:45:20+09:00 Subject: Re: object-name = content of a variable (migration from perl) Thanks for your effort. Indead I didn't know the method eval() (neither in perl nor in ruby) and its exactly what I need. Now my solution is very simple: while (i < 10) p = i.to_s o_name = 'name' + p eval("#{o_name} = CLass.new(#{i},'something')") i += 1 end rene >>>>>>>>>>>>>>>>>> Urspr�ngliche Nachricht <<<<<<<<<<<<<<<<<< Am 29.05.02, 21:57:32, schrieb Michael Campbell zum Thema Re: object-name = content of a variable (migration from perl): > --- Marc Rene Arns wrote: > > I'm not sure if you got me right. The dynamically changing > > array-names was in respect to the abilities of PERL. > One poster used "eval" to do this, which is certainly possible. > I have to ask though... why? Just to see how ruby mimics a perl > language feature? > If I recall correctly, perl's soft references are little more than > syntactic sugar for a specific form of "eval" anyway. > ===== > -- > Yahoo IM: michael_s_campbell > __________________________________________________ > Do You Yahoo!? > Yahoo! - Official partner of 2002 FIFA World Cup > http://fifaworldcup.yahoo.com