Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Copy of an anonymous hash?

by pelagic (Curate)
on Apr 26, 2005 at 11:42 UTC ( #451506=note: print w/ replies, xml ) Need Help??


in reply to Copy of an anonymous hash?

Dear Anonymous,
The topic of your problem is called deep copy
and it's worth while searchingfor it ...
and he has a column on it ...


pelagic


Comment on Re: Copy of an anonymous hash?
Re^2: Copy of an anonymous hash?
by salva (Monsignor) on Apr 26, 2005 at 12:18 UTC
    deep copy is not always the solution:

    There is shallow copy in one extreme and deep copy in the other an in the middle lots of intermediate solutions, which one is the good one depends on the particular data representation.

    For instance, if you are cloning an object representing an XML node, you will like to deep-copy all its children but not the pointer to its parent.

      100% agreed!
      I didn't say deep copy is the solution, I said it's the topic ;)

      pelagic

      Shallow copy is usually a good solution: all you need is to do a shallow copy whenever you change a structure.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://451506]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2014-07-23 23:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (154 votes), past polls