Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: deep copy of nested data structure

by davorg (Chancellor)
on Nov 22, 2000 at 14:12 UTC ( [id://42895]=note: print w/replies, xml ) Need Help??


in reply to deep copy of nested data structure

The thaw function in FreezeThaw returns an array which you are assigning to a scalar. The scalar ($copy) therefore ends up getting the number of elements in the array (in this case 1).

Try replacing your code with this:

($copy) = thaw freeze $hashref;

to force an array assignment.

--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-03-28 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found