Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: deep copy of nested data structure

by davorg (Chancellor)
on Nov 22, 2000 at 14:12 UTC ( #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? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2021-11-29 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?