Subject: | Data structure with empty elements not preserved |
Perl: v5.8.5 built for i686-linux
OS: Linux 2.6.11-gentoo-r5GBS
In a nested data structure with empty values, the thawed result does not preserve the original structure. In this example, the data structure is an array reference containing three other array references, each of which has 60 values of '0'. The structure freezes properly, so I include only the result of freeze.
my $frozen = "FrT;@1|@3|@60|$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0@60|$1|0$1|0$1|0$1|0$1|0$1|1$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0@60|$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0$1|0";
my $struct;
eval {
$struct = thaw($frozen);
};
The result is that $struct is undefined and $@ is empty.