On 29.12.2009 07:15, timr wrote:

> You are right about the strings having the same object_ids in each
> object, which explains why the modification on the dupped object
> affects the original strings. That helps. But the suggested strategy
> doesn't solve the problem:

irb(main):001:0> array = ["string"]
=> ["string"]
irb(main):002:0> array_dup = []
=> []
irb(main):003:0> array_dup[0] = array[0].clone
=> "string"
irb(main):004:0> array_dup[0].object_id
=> 30816948
irb(main):005:0> array[0].object_id
=> 30838824

--
Phillip Gawlowski