develooper Front page | perl.perl5.porters | Postings from November 2007

Re: Storable issue

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
November 5, 2007 07:25
Subject:
Re: Storable issue
Message ID:
20071105152434.GF87952@plum.flirble.org
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::Dumper -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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About