Re: disjoint copy one hash to another




Quoth "ram@xxxxxxxxxxxx" <ramprasad.ap@xxxxxxxxx>:
When I create a copy of a hash array, the operation on the copy hash
seems to affect the original hash
( when the values are reference elements )

How do I avoid this ?

use Clone; # or one of the Clone::* alternatives

Ben

--
"If a book is worth reading when you are six, * ben@xxxxxxxxxxxx
it is worth reading when you are sixty." [C.S.Lewis]
.



Relevant Pages

  • Re: disjoint copy one hash to another
    ... seems to affect the original hash ... (when the values are reference elements) ... How do I avoid this? ... See dclone in Storable: ...
    (comp.lang.perl.misc)
  • Re: disjoint copy one hash to another
    ... seems to affect the original hash ... (when the values are reference elements) ... How do I avoid this? ... Try to search on CPAN with keyword of "deep copy". ...
    (perl.beginners)
  • Re: Change in C
    ... but please do it without spamming> ... this allows you to avoid all the technical points of my ... advertising opportunity, I doubt very much whether the technical ... proposal is worth reading. ...
    (comp.lang.c)
  • Re: So long and thanks for all the fish.
    ... I think most people want an end to the rants and the personal attacks. ... it's very difficult to avoid the latter when correcting those who set out to ... perhaps they should just be dismissed as not worth reading. ...
    (comp.sys.acorn.misc)
  • Re: Building design & WiFi problem
    ... Learn not to bottom post. ... Avoid posting anything that you would not consider worth reading. ... See Q7 of "Quoting Style in Newsgroup Postings" ...
    (alt.internet.wireless)