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.--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me