A
Andrew Walrond
Is there a deep copy function that I've missed somehow? (dup and clone are
both shallow copy functions).
E.g. How can I make a deep copy of a Hash?
Ie if
a=['who'=>'me'],
I want
b = a.deepcopy
Such that
b['who'].replace('you')
doesn't result in
a == ['who'=>'you']
I could do
b=YAML::load(YAML::dump(a)
but it reeks of _wrongness_
Andrew Walrond
both shallow copy functions).
E.g. How can I make a deep copy of a Hash?
Ie if
a=['who'=>'me'],
I want
b = a.deepcopy
Such that
b['who'].replace('you')
doesn't result in
a == ['who'=>'you']
I could do
b=YAML::load(YAML::dump(a)
but it reeks of _wrongness_
Andrew Walrond