in reply to Compress::Zlib : what to do with the "in memory" data ?
I use Compress::Zlib for a number of in-memeory (un)compressions. I don't have any examples on hand for generating a file (I store to a database), but I did do that in tests to be sure the compressed data in the db could alternately be SELECT'd to a file and uncompressed with gzip.
my $zipped_raw = Compress::Zlib::memGzip($raw_genome); my $raw_genome = Compress::Zlib::memGunzip($zipped_raw);
So if you wanted to compress in memory and save to file based on your example:
$fu = "bla bla bla bla" ; $ba = Compress::Zlib::memGzip( $fu ) ; open FFF, ">ba.txt.gz" or die "$!" ; print FFF $ba; close (FFF) ;
However Compress::Zlib has methods that handle reading and writing gzip files built in.
$gz->gzwrite($buffer) ;Which you may want to look at first if that's all your after.
HTH
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Compress::Zlib : what to do with the "in memory" data ?
by ZlR (Chaplain) on Jan 07, 2005 at 20:13 UTC | |
by iburrell (Chaplain) on Jan 08, 2005 at 00:32 UTC | |
by ZlR (Chaplain) on Jan 08, 2005 at 13:23 UTC |