Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: Deepcopy of complex structures.

by BrowserUk (Patriarch)
on Jan 21, 2003 at 10:17 UTC ( [id://228638]=note: print w/replies, xml ) Need Help??


in reply to Re: Deepcopy of complex structures.
in thread Deepcopy of complex structures.

Indeed, for simple scalars, localising a copy (or just my'ing a local copy) will take care undoing changes as the program recurses.

However, if the scalar in question is a ref to an array or hash, localising the ref will undo any changes to the ref itself, but it won't undo any changes to the structure referenced.


Examine what is said, not who speaks.

The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.

  • Comment on Re: Re: Deepcopy of complex structures.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-25 02:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found