Quoting Nicholas Clark <nick ccl4.org>:
Thanks- the practical ramification is though that apparently
the two
data structures are identical and can be used
interchangeably,
despite the fact that the files that store them have
different sizes.
> On Sat, Oct 27, 2007 at 09:36:38PM +0300, moka hol.gr
wrote:
>> I have come across a case where two identical data
structrures are
>> stored in two different files using the storable
module. The only
>> thing is the filesizes of these two files is
different, maybe by as
>> much as 10%.
>> Any ideas why this is so?
>
> $ perl -MData: umper
-MStorable -0777 -we 'foreach ( ARGV) { print
> Dumper Storable::read_magic do {open FH, $_ and
<FH> }}'
> /tmp/destdighash /tmp/destdighashnew
> $VAR1 = {
> 'netorder' => 0,
> 'hdrsize' => 13,
> 'version' => 1,
> 'file' => 1,
> 'longsize' => 4,
> 'ptrsize' => 4,
> 'version_nv' => 1,
> 'byteorder' => '1234',
> 'major' => 1,
> 'intsize' => 4
> };
> $VAR1 = {
> 'netorder' => 0,
> 'hdrsize' => 15,
> 'version' => '2.6',
> 'minor' => 6,
> 'file' => 1,
> 'longsize' => 4,
> 'ptrsize' => 4,
> 'version_nv' => '2.006',
> 'byteorder' => '1234',
> 'nvsize' => 8,
> 'major' => 2,
> 'intsize' => 4
> };
> $ ls -l /tmp/destdighash*
> -rw------- 1 nick wheel 8872 Nov 5 15:13
/tmp/destdighash
> -rw------- 1 nick wheel 7938 Nov 5 15:13
/tmp/destdighashnew
>
>
> All I can say for sure is that the second file is
generated by a
> newer version
> of Storable. I don't know why it is able to write out
the data in a more
> compact format.
>
> Nicholas Clark
>
|