From: Lyndon Samson Date: 2005-04-29T03:40:54+09:00 Subject: Re: Deep copy? On 4/29/05, Andrew Walrond wrote: > 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_ ;) The idiom of choice seems to be to use Marshall instead. > > Andrew Walrond > > -- Into RFID? www.rfidnewsupdate.com Simple, fast, news.