On Jun 1, 2004, at 4:53 AM, orbit wrote:

> orbit / klientsky.ru (orbit) wrote in message 
> news:<734420e9.0405310551.2526ea0 / posting.google.com>...
>> Whot can I set value for variable which name cosist ather variable?
>>
>> var1 = "@var2"
>
> I want, that as in Perl was
> cat p1.pl
>
> #!/usr/bin/perl
>
> $foo = "xo-xo";
> print "1 - foo = $foo\n";
> $scalarref = \$foo;
> $$scalarref = "xe-xe";
> print "2 - foo = $foo\n";
>
> ../p1.pl
> 1 - foo = xo-xo
> 2 - foo = xe-xe

You probably want something like this:

   b=a="test"
     ==>"test"
   a.replace "hello"
     ==>"hello"
   [a,b]
     ==>["hello", "hello"]

String#replace replaces the contents of the string with the argument 
passed.

But everything in ruby is done by reference, so there is no clean way 
of doing what you are talking about that works for every type. This is 
one of those things that really bugged me at first, but I eventually 
liked; Not being able to do tricks like that doesn't seem to hamper my 
code any, and leaves it much easier to understand.

I would recommend leaving the pointers to C and Perl :)

cheers,
Mark