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

Storable issue

Thread Next
From:
moka
Date:
October 27, 2007 19:02
Subject:
Storable issue
Message ID:
20071027213638.5e9scqodgk0wgwkg@easymail-app.hol.gr
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?

Thanks,
Spiros Alexiou

> perl compare.pl destdighash destdighashnew
structures of destdighash and destdighashnew are identical.
Died at compare.pl line 12.
me@linuxblushingSECUR/KPI> ls -l destdig*
-rw-r--r--  1 me users 8872 2007-10-20 02:00 destdighash
-rw-r--r--  1 me users 7938 2007-10-25 21:25 destdighashnew

here is the script:
use strict;
use Storable;
  use Data::Compare;

require('dumpvar.pl');
my $file1=shift; my $file2=shift;#e.g. destdighash, destdighashnew
if(-e "$file1"){  $main::rdestdighash=retrieve("$file1");}else{die  
"could not find $file1 to get hashref1 from\n";}
if(-e "$file2"){  $main::rdestdighashnew=retrieve("$file2");}else{die  
"could not find $file2 to get hashref2 from\n";}

print "structures of $file1 and $file2 are ",
       Compare($main::rdestdighash, $main::rdestdighashnew) ? "" :  
"not ", "identical.\n";
die;

My only guess as to the size difference is that the original one was  
created on an older(though also linux) system.
  STill , I cannot figure out why this could happen

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