On 5/4/05, Eric Mahurin <eric_mahurin / yahoo.com> wrote:
> In ruby, is there a way to get a handle of an object reference?
>  In perl, this is the \ operator:
> 
> $x = 1; # \$x is a handle to change $x
> $a = [1,2,3]; # \$a->[1] is a handle to change an element in $a
> 

Not the "ruby way," but how about:

a = [1, 2,  3]
b = a.object_id
c = ObjectSpace._id2ref(b)
c[1] = 7
puts a                       => [1, 7, 3]