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.
--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
In reply to Re: deep copy of nested data structure
by davorg
in thread deep copy of nested data structure
by klash
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |