Quoth Peng Yu <
[email protected]>:
Uh, gzip the data once you've serialized it? You can use
IO::Compress::Gzip to do the compression for you, and you can use
Storable::freeze rather than Storable::store to avoid the temporary file
if your data's small enough.
Will there be roughly the same level of compression rate if I store
the freezed object compared with that I gzip the compress the file
stored without freeze?
I got the following error. Would you please let me know what I am
wrong?
#!/usr/bin/perl
use strict;
use warnings;
use Storable;
use Data:

umper;
my %hash = (
a=>[1,2,3],
b=>['x','y','z'],
);
my $serialized = freeze \%hash;
store \$serialized, "freeze.pdata";
print Dumper(\$serialized);
Backslash found where operator expected at ./freeze.pl line 14, near
"freeze \"
(Do you need to predeclare freeze?)
syntax error at ./freeze.pl line 14, near "freeze \"
Execution of ./freeze.pl aborted due to compilation errors.