Try using the inflate method as taken from the perldoc for
Compress::Zlib.
There is a difference in how the headers are written
which explains why the the second method is incompatible
with gzip.
Note that for zip file manipulation, the docs suggest using Archive::Zip which I would guess is a reason for the default behaviour. I'm still looking into this, but maybe this will help?
#!/usr/bin/perl use strict; use warnings; use Compress::Zlib; my $x = inflateInit() or die "Cannot create inflation stream"; my $input = ""; binmode STDIN; binmode STDOUT; my ($output, $status); while (read(STDIN, $input, 4096)) { ($output, $status) = $x->inflate(\$input); print $output if $status == Z_OK or $status == Z_STREAM_END; last if $status != Z_OK; }
In reply to Re: Different compression behaviours with Compress::Zlib
by lemming
in thread Different compression behaviours with Compress::Zlib
by grinder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |