ZlR has asked for the wisdom of the Perl Monks concerning the following question:
I must admit i haven't searched much for an answer but the docs are not very clear, it's the end of the week and there is something i don't quite understand ...
Here's what i do :
This produces a file with binary data in it but it doesnt seem to be a valid .Z file (or .gz for that matter...). I doubt this is the way the compress method is suposed to be used ...$fu = "bla bla bla bla" ; $ba = compress ( $fu ) ; open FFF, ">ba.txt.Z" or die "$!" ; print FFF $ba; close (FFF) ;
The doc says :
$dest = compress($source) ;
Compresses $source. If successful it returns the compressed data. Otherwise it returns undef.
The source buffer can either be a scalar or a scalar reference.
I also tried with binmode FFF , and still no luck .
I'm missing something about buffer and in memory so if someone could explain this to me , it'd be great !!
ZlR.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Compress::Zlib : what to do with the "in memory" data ?
by spq (Friar) on Jan 07, 2005 at 17:31 UTC | |
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 | |
|
Re: Compress::Zlib : what to do with the "in memory" data ?
by zentara (Cardinal) on Jan 08, 2005 at 12:47 UTC |