Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Pass by value acts like pass by reference

by demerphq (Chancellor)
on Jul 11, 2004 at 19:30 UTC ( #373505=note: print w/replies, xml ) Need Help??


in reply to Re: Pass by value acts like pass by reference
in thread Pass by value acts like pass by reference

When you flatten a hash you are getting a shallow copy of the hash, not a deep copy. To get a deep copy you need to use some form of serialization mechanism to do it. Storable will probably be your best bet in terms of speed and memory consumption. Of course,it may be a lot easier to just change your algorithm to not corrupt the original arrays....


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi


  • Comment on Re^2: Pass by value acts like pass by reference

Replies are listed 'Best First'.
Re^3: Pass by value acts like pass by reference
by Anonymous Monk on Jul 12, 2004 at 20:12 UTC
    Of course,it may be a lot easier to just change your algorithm to not corrupt the original arrays....

    That was what I ended up doing, thanks to to tilly's suggestion. Thank you to all who responded.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2023-01-27 13:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?