Subject: | Filter::Decompress example WANT_GZIP_OR_ZLIB |
Date: | Mon, 28 Dec 2009 10:58:33 +1100 |
To: | bug-Filter [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
In the Filter::Decompress example in the sources, the inflateInit could
helpfully be made
inflateInit (-WindowBits => MAX_WBITS() + WANT_GZIP_OR_ZLIB())
so as to accept both zlib format and gzip format. I tried the code with
perl -MFilter::Decompress foo.pl.gz
to run a compressed script and it silently did nothing -- until I hunted
down to inflate() not liking the gzip header without a suitable WANT
flag in the options.
Since Compress::Zlib is supplied with perl 5.10, Filter::Decompress
might even be installed ready to run, for cute use on .pl.gz files. Or
was that how it was before and then taken away ...
(Incidentally the "closure" version of Filter::Decompress may be missing
a "my" for $err.)