A
Andrew
I'm trying to create an hash object using object string for key and
value.
I need to link a key with another key as value... so an element of hash
object can point to another element. But i need the link to the key and
not a copy of the value.
I have tried in this way:
@my_hash["one"] = "First"
@my_hash["two"] = "Second"
@my_hash["three"] = "Third"
@my_hash["four"] = @my_hash["T1"]
Now if I modify
@my_hash["one"] = "Modify"
I would like to see the new value also for
@my_hash["four"] => "Modify"
but I see "First" because i think it do a copy.
The problem is that i woult like to refer the element end not to copy
it.
Thanks so much and sorry for my english.
Andreaw
value.
I need to link a key with another key as value... so an element of hash
object can point to another element. But i need the link to the key and
not a copy of the value.
I have tried in this way:
@my_hash["one"] = "First"
@my_hash["two"] = "Second"
@my_hash["three"] = "Third"
@my_hash["four"] = @my_hash["T1"]
Now if I modify
@my_hash["one"] = "Modify"
I would like to see the new value also for
@my_hash["four"] => "Modify"
but I see "First" because i think it do a copy.
The problem is that i woult like to refer the element end not to copy
it.
Thanks so much and sorry for my english.
Andreaw