Compress::Zlib(3pm)
π¦ Compress::Zlib(3pm) π¦
From the Perl Programmers Reference Guide, bestie: this is the Compress::Zlib(3pm) page, and we are absolutely going to make zlib make sense together π«Ά
πΈ NAME πΈ
Compress::Zlib β it's literally the interface to the zlib compression library. That's the vibe π
β¨ SYNOPSIS β¨
use Compress::Zlib ;
($d, $status) = deflateInit( [OPT] ) ;
$status = $d->deflate($input, $output) ;
$status = $d->flush([$flush_type]) ;
$d->deflateParams(OPTS) ;
$d->deflateTune(OPTS) ;
$d->dict_adler() ;
$d->crc32() ;
$d->adler32() ;
$d->total_in() ;
$d->total_out() ;
$d->msg() ;
$d->get_Strategy();
$d->get_Level();
$d->get_BufSize();
($i, $status) = inflateInit( [OPT] ) ;
$status = $i->inflate($input, $output [, $eof]) ;
$status = $i->inflateSync($input) ;
$i->dict_adler() ;
$d->crc32() ;
$d->adler32() ;
$i->total_in() ;
$i->total_out() ;
$i->msg() ;
$d->get_BufSize();
$dest = compress($source) ;
$dest = uncompress($source) ;
$gz = gzopen($filename or filehandle, $mode) ;
$bytesread = $gz->gzread($buffer [,$size]) ;
$bytesread = $gz->gzreadline($line) ;
$byteswritten = $gz->gzwrite($buffer) ;
$status = $gz->gzflush($flush) ;
$offset = $gz->gztell() ;
$status = $gz->gzseek($offset, $whence) ;
$status = $gz->gzclose() ;
$status = $gz->gzeof() ;
$status = $gz->gzsetparams($level, $strategy) ;
$errstring = $gz->gzerror() ;
$gzerrno
$dest = Compress::Zlib::memGzip($buffer) ;
$dest = Compress::Zlib::memGunzip($buffer) ;
$crc = adler32($buffer [,$crc]) ;
$crc = crc32($buffer [,$crc]) ;
$crc = crc32_combine($crc1, $crc2, $len2);
$adler = adler32_combine($adler1, $adler2, $len2);
my $version = Compress::Raw::Zlib::zlib_version();
π DESCRIPTION π
The Compress::Zlib module gives you a Perl interface to the zlib compression library β see "AUTHOR" for the details about where to get zlib π
Compress::Zlib splits into two general areas of functionality, and yes bestie, we're covering both:
- a simple read/write interface to gzip files
- a low-level in-memory compression/decompression interface
Each of these areas gets discussed in the sections that follow. No skipping, we're doing this properly β¨
π Notes for users of Compress::Zlib version 1 π
The main change in Compress::Zlib version 2.x is that it does not now interface directly to the zlib library. Instead it uses the IO::Compress::Gzip and IO::Uncompress::Gunzip modules for reading/writing gzip files, and the Compress::Raw::Zlib module for some low-level zlib access.
The interface provided by version 2 of this module should be 100% backward compatible with version 1. If you find a difference in the expected behaviour please contact the author (See "AUTHOR"). See "GZIP INTERFACE".
With the creation of the IO::Compress and IO::Uncompress modules no new features are planned for Compress::Zlib β the new modules do everything that Compress::Zlib does and then some. Development on Compress::Zlib will be limited to bug fixes only.
If you are writing new code, your first port of call should be one of the new IO::Compress or IO::Uncompress modules. That's the main character energy π
π GZIP INTERFACE π
A number of functions are supplied in zlib for reading and writing gzip files that conform to RFC 1952. This module provides an interface to most of them.
If you have previously used Compress::Zlib 1.x, the following enhancements/changes have been made to the gzopen interface:
- If you want to open either
STDINorSTDOUTwithgzopen, you can now optionally use the special filename"-"as a synonym for\*STDINand\*STDOUT. - In
Compress::Zlibversion 1.x,gzopenused the zlib library to open the underlying file. This made things especially tricky when a Perl filehandle was passed togzopen. Behind the scenes the numeric C file descriptor had to be extracted from the Perl filehandle and this passed to the zlib library.
Apart from being non-portable to some operating systems, this made it difficult to use gzopen in situations where you wanted to extract/create a gzip data stream that is embedded in a larger file, without having to resort to opening and closing the file multiple times.
It also made it impossible to pass a perl filehandle that wasn't associated with a real filesystem file, like, say, an IO::String.
In Compress::Zlib version 2.x, the gzopen interface has been completely rewritten to use the IO::Compress::Gzip for writing gzip files and IO::Uncompress::Gunzip for reading gzip files. None of the limitations mentioned above apply.
- Addition of
gzseekto provide a restrictedseekinterface. - Added
gztell.
A more complete and flexible interface for reading/writing gzip files/buffers is included with the module IO-Compress-Zlib. See IO::Compress::Gzip and IO::Uncompress::Gunzip for more details.
π« $gz = gzopen($filename, $mode) / $gz = gzopen($filehandle, $mode) π«
This function opens either the gzip file $filename for reading or writing or attaches to the opened filehandle, $filehandle. It returns an object on success and undef on failure.
When writing a gzip file this interface will always create the smallest possible gzip header (exactly 10 bytes). If you want greater control over what gets stored in the gzip header (like the original filename or a comment) use IO::Compress::Gzip instead. Similarly if you want to read the contents of the gzip header use IO::Uncompress::Gunzip.
The second parameter, $mode, is used to specify whether the file is opened for reading or writing and to optionally specify a compression level and compression strategy when writing. The format of the $mode parameter is similar to the mode parameter to the 'C' function fopen, so "rb" is used to open for reading, "wb" for writing and "ab" for appending (writing at the end of the file).
To specify a compression level when writing, append a digit between 0 and 9 to the mode string β 0 means no compression and 9 means maximum compression. If no compression level is specified Z_DEFAULT_COMPRESSION is used.
To specify the compression strategy when writing, append 'f' for filtered data, 'h' for Huffman only compression, or 'R' for run-length encoding. If no strategy is specified Z_DEFAULT_STRATEGY is used.
So, for example, "wb9" means open for writing with the maximum compression using the default strategy and "wb4R" means open for writing with compression level 4 and run-length encoding.
Refer to the zlib documentation for the exact format of the $mode parameter.
π« $bytesread = $gz->gzread($buffer [, $size]) ; π«
Reads $size bytes from the compressed file into $buffer. If $size is not specified, it will default to 4096. If the scalar $buffer is not large enough, it will be extended automatically.
Returns the number of bytes actually read. On EOF it returns 0 and in the case of an error, -1.
π« $bytesread = $gz->gzreadline($line) ; π«
Reads the next line from the compressed file into $line.
Returns the number of bytes actually read. On EOF it returns 0 and in the case of an error, -1.
It is legal to intermix calls to gzread and gzreadline.
To maintain backward compatibility with version 1.x of this module gzreadline ignores the $/ variable β it always uses the string "\n" as the line delimiter.
If you want to read a gzip file a line at a time and have it respect the $/ variable (or $INPUT_RECORD_SEPARATOR, or $RS when English is in use) see IO::Uncompress::Gunzip.
π« $byteswritten = $gz->gzwrite($buffer) ; π«
Writes the contents of $buffer to the compressed file. Returns the number of bytes actually written, or 0 on error.
π« $status = $gz->gzflush($flush_type) ; π«
Flushes all pending output into the compressed file.
This method takes an optional parameter, $flush_type, that controls how the flushing will be carried out. By default the $flush_type used is Z_FINISH. Other valid values for $flush_type are Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH and Z_BLOCK.
β οΈ It is strongly recommended that you only set theflush_typeparameter if you fully understand the implications of what it does β overuse offlushcan seriously degrade the level of compression achieved. See the"zlib"documentation for details. π
Returns 0 on success.
π« $offset = $gz->gztell() ; π«
Returns the uncompressed file offset.
π« $status = $gz->gzseek($offset, $whence) ; π«
Provides a sub-set of the seek functionality, with the restriction that it is only legal to seek forward in the compressed file. It is a fatal error to attempt to seek backward.
When opened for writing, empty parts of the file will have NULL (0x00) bytes written to them.
The $whence parameter should be one of SEEK_SET, SEEK_CUR or SEEK_END.
Returns 1 on success, 0 on failure.
π« $gz->gzclose π«
Closes the compressed file. Any pending data is flushed to the file before it is closed.
Returns 0 on success.
π« $gz->gzsetparams($level, $strategy π«
Change settings for the deflate stream $gz.
The list of the valid options is shown below. Options not specified will remain unchanged.
Note: This method is only available if you are running zlib 1.0.6 or better.
$level
Defines the compression level. Valid values are 0 through 9, Z_NO_COMPRESSION, Z_BEST_SPEED, Z_BEST_COMPRESSION, and Z_DEFAULT_COMPRESSION.
$strategy
Defines the strategy used to tune the compression. The valid values are Z_DEFAULT_STRATEGY, Z_FILTERED and Z_HUFFMAN_ONLY.
π« $gz->gzerror π«
Returns the zlib error message or number for the last operation associated with $gz. The return value will be the zlib error number when used in a numeric context and the zlib error message when used in a string context. The zlib error number constants, shown below, are available for use.
Z_OK
Z_STREAM_END
Z_ERRNO
Z_STREAM_ERROR
Z_DATA_ERROR
Z_MEM_ERROR
Z_BUF_ERROR
π« $gzerrno π«
The $gzerrno scalar holds the error code associated with the most recent gzip routine. Note that unlike gzerror(), the error is not associated with a particular file.
Okay bestie, so real quick on the error situation: just like gzerror(), it returns an error number in numeric context and an error message in string context. π
But β plot twist β unlike gzerror() though, the error message will correspond to the zlib message when the error is associated with zlib itself, or the UNIX error message when it is not (i.e. zlib returned "Z_ERRORNO"). π
Heads up: because there is an overlap between the error numbers used by zlib and UNIX,$gzerrnoshould only be used to check for the presence of an error in numeric context. Usegzerror()to check for specific zlib errors. Thegzcatexample below shows how the variable can be used safely. π
β¨ Examples β¨
Here is an example script which uses the interface. It implements a gzcat function. Obsessed:
use strict ;
use warnings ;
use Compress::Zlib ;
# use stdin if no files supplied
@ARGV = '-' unless @ARGV ;
foreach my $file (@ARGV) {
my $buffer ;
my $gz = gzopen($file, "rb")
or die "Cannot open $file: $gzerrno\n" ;
print $buffer while $gz->gzread($buffer) > 0 ;
die "Error reading from $file: $gzerrno" . ($gzerrno+0) . "\n"
if $gzerrno != Z_STREAM_END ;
$gz->gzclose() ;
}
Below is a script which makes use of "gzreadline". It implements a very simple grep like script. So cute:
use strict ;
use warnings ;
use Compress::Zlib ;
die "Usage: gzgrep pattern [file...]\n"
unless @ARGV >= 1;
my $pattern = shift ;
# use stdin if no files supplied
@ARGV = '-' unless @ARGV ;
foreach my $file (@ARGV) {
my $gz = gzopen($file, "rb")
or die "Cannot open $file: $gzerrno\n" ;
while ($gz->gzreadline($_) > 0) {
print if /$pattern/ ;
}
die "Error reading from $file: $gzerrno\n"
if $gzerrno != Z_STREAM_END ;
$gz->gzclose() ;
}
This script, gzstream, does the opposite of the gzcat script above. It reads from standard input and writes a gzip data stream to standard output. Main character energy:
use strict ;
use warnings ;
use Compress::Zlib ;
binmode STDOUT; # gzopen only sets it on the fd
my $gz = gzopen(\*STDOUT, "wb")
or die "Cannot open stdout: $gzerrno\n" ;
while (<>) {
$gz->gzwrite($_)
or die "error writing: $gzerrno\n" ;
}
$gz->gzclose ;
π Compress::Zlib::memGzip π
This function is used to create an in-memory gzip file with the minimum possible gzip header (exactly 10 bytes). Tiny icon behavior:
$dest = Compress::Zlib::memGzip($buffer)
or die "Cannot compress: $gzerrno\n";
If successful, it returns the in-memory gzip file. Otherwise it returns "undef" and the $gzerrno variable will store the zlib error code. The $buffer parameter can either be a scalar or a scalar reference. See IO::Compress::Gzip for an alternative way to carry out in-memory gzip compression. π«Ά
π§ Compress::Zlib::memGunzip π§
This function is used to uncompress an in-memory gzip file.
$dest = Compress::Zlib::memGunzip($buffer)
or die "Cannot uncompress: $gzerrno\n";
If successful, it returns the uncompressed gzip file. Otherwise it returns "undef" and the $gzerrno variable will store the zlib error code. The $buffer parameter can either be a scalar or a scalar reference. The contents of the $buffer parameter are destroyed after calling this function. π
If$bufferconsists of multiple concatenated gzip data streams only the first will be uncompressed. Use"gunzip"with the"MultiStream"option in the"IO::Uncompress::Gunzip"module if you need to deal with concatenated data streams. π
See IO::Uncompress::Gunzip for an alternative way to carry out in-memory gzip uncompression. π¦
π COMPRESS/UNCOMPRESS π
Two functions are provided to perform in-memory compression/uncompression of RFC 1950 data streams. They are called "compress" and "uncompress". Slay:
$dest = compress($source [, $level] ) ;
Compresses $source. If successful it returns the compressed data. Otherwise it returns undef. The source buffer, $source, can either be a scalar or a scalar reference. The $level parameter defines the compression level. Valid values are 0 through 9, "Z_NO_COMPRESSION", "Z_BEST_SPEED", "Z_BEST_COMPRESSION", and "Z_DEFAULT_COMPRESSION". If $level is not specified "Z_DEFAULT_COMPRESSION" will be used. β¨
$dest = uncompress($source) ;
Uncompresses $source. If successful it returns the uncompressed data. Otherwise it returns undef. The source buffer can either be a scalar or a scalar reference. π
Please note: the two functions defined above are not compatible with the Unix commands of the same name. π«
See IO::Deflate and IO::Inflate included with this distribution for an alternative interface for reading/writing RFC 1950 files/buffers. πΈ
π₯ DEFLATE INTERFACE π₯
okay so now we're doing in-memory compression, using the deflate interface that zlib gives us. it's giving "build your own compression stream, you're the main character" energy. π«Ά
here's what the interface looks like:
π ($d, $status) = deflateInit( [OPT] )
boots up a deflation stream. β¨
it's literally a combo move β it bundles the features of the zlib functions deflateInit, deflateInit2 and deflateSetDictionary into one.
if it works, you get the initialised deflation stream $d and $status of Z_OK back in a list context. in scalar context, it hands you just the deflation stream, $d, and nothing else. π
if it does not work, the deflation stream it returns ($d) will be undef and $status will hold the exact zlib error code β no cap, the real one.
the function optionally takes a bunch of named options passed as -Name=>value pairs. that's so you can tweak individual options without having to spell out every single one in the parameter list. π
for backward compatibility, you can also pass the parameters as a reference to a hash holding the name=>value pairs. (iykyk, legacy vibes.)
so basically the function takes one optional parameter: a reference to a hash. the contents of that hash let you tailor the deflation interface however you want.
here's the list of valid options, bestie:
-Levelβ defines the compression level. valid values are0through9,Z_NO_COMPRESSION,Z_BEST_SPEED,Z_BEST_COMPRESSION, andZ_DEFAULT_COMPRESSION. the default isZ_DEFAULT_COMPRESSION.-Methodβ defines the compression method. the only valid value at present (and the default) isZ_DEFLATED.-WindowBitsβ to create an RFC 1950 data stream, setWindowBitsto a positive number. to create an RFC 1951 data stream, setWindowBitsto-MAX_WBITS. for the full definition of whatWindowBitsmeans and which values are valid, go look at the zlib documentation for deflateInit2. defaults toMAX_WBITS.-MemLevelβ for the meaning and valid values ofMemLevel, check the zlib documentation for deflateInit2. defaults toMAX_MEM_LEVEL.-Strategyβ defines the strategy used to tune the compression. valid values areZ_DEFAULT_STRATEGY,Z_FILTEREDandZ_HUFFMAN_ONLY. the default isZ_DEFAULT_STRATEGY.-Dictionaryβ when you specify a dictionary, Compress::Zlib will automatically calldeflateSetDictionaryright after callingdeflateInit. you can grab the Adler32 value for the dictionary by calling the method$d->dict_adler(). the default is no dictionary.-Bufsizeβ sets the initial size for the deflation buffer. if the buffer has to be reallocated to get bigger, it grows in increments ofBufsize. the default is4096.
here's a lil example of using the deflateInit optional parameter list to override the default buffer size and compression level. every other option just chills at its default value: πΈ
deflateInit( -Bufsize => 300,
-Level => Z_BEST_SPEED ) ;
π ($out, $status) = $d->deflate($buffer)
this one deflates the contents of $buffer. the buffer can be a scalar or a scalar reference, whatever you're feeling. when it's done, $buffer will have been completely processed (assuming nothing errored out). if the deflation went well, you get the deflated output $out and a status value $status of Z_OK. β¨
on error, $out will be undef and $status will contain the zlib error code.
in a scalar context, deflate returns just $out.
and just like the deflate function in zlib itself: it is not necessarily the case that this method produces any output at all. so please don't be out here using "$out is empty" as your error test. π
π¦ ($out, $status) = $d->flush() and ($out, $status) = $d->flush($flush_type)
typically this is the one you use to finish the deflation. any pending output comes back to you through $out. $status will have the value Z_OK if everything's good. π
in a scalar context, flush returns just $out.
β οΈ heads up bestie: flushing can seriously degrade the compression ratio. so only use it to terminate a decompression (usingZ_FINISH) or when you actually want to create a full flush point (usingZ_FULL_FLUSH). no casual flushing. π
by default the flush_type used is Z_FINISH. other valid values for flush_type are Z_NO_FLUSH, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH and Z_FULL_FLUSH. it is strongly recommended that you only set the flush_type parameter if you fully understand the implications of what it does. see the zlib documentation for the details, fr fr.
β $status = $d->deflateParams([OPT])
changes the settings for the deflate stream $d. π
here's the list of valid options. any option you don't specify just stays exactly as it was.
-Levelβ defines the compression level. valid values are0through9,Z_NO_COMPRESSION,Z_BEST_SPEED,Z_BEST_COMPRESSION, andZ_DEFAULT_COMPRESSION.-Strategyβ defines the strategy used to tune the compression. valid values areZ_DEFAULT_STRATEGY,Z_FILTEREDandZ_HUFFMAN_ONLY.
π
$d->dict_adler()
returns the adler32 value for the dictionary.
π
$d->msg()
returns the last error message generated by zlib.
π
$d->total_in()
returns the total number of bytes uncompressed bytes input to deflate.
π
$d->total_out()
returns the total number of compressed bytes output from deflate.
π Example
here's a trivial little example of using deflate. it simply reads standard input, deflates it, and writes it to standard output. iconic behaviour honestly. π
use strict ;
use warnings ;
use Compress::Zlib ;
binmode STDIN;
binmode STDOUT;
my $x = deflateInit()
or die "Cannot create a deflation stream\n" ;
my ($output, $status) ;
while (<>)
{
($output, $status) = $x->deflate($_) ;
$status == Z_OK
or die "deflation failed\n" ;
print $output ;
}
($output, $status) = $x->flush() ;
$status == Z_OK
or die "deflation failed\n" ;
print $output ;
π§ INFLATE INTERFACE π§
this section defines the interface that lets you do in-memory *un*compression using the deflate interface provided by zlib. yes, the naming is a whole situation, we don't talk about it. π
here's the interface:
πΈ ($i, $status) = inflateInit()
initialises an inflation stream. π«Ά
in a list context it returns the inflation stream $i and the zlib status code in $status. in a scalar context it returns just the inflation stream.
if it works, $i holds the inflation stream and $status will be Z_OK.
if it doesn't work, $i will be undef and $status will hold the zlib error code.
the function optionally takes a number of named options specified as -Name=>value pairs, so you can tailor individual options without specifying them all in the parameter list. for backward compatibility, you can also pass the parameters as a reference to a hash containing the name=>value pairs.
the function takes one optional parameter, a reference to a hash. the contents of the hash allow the deflation interface to be tailored. (yes it says "deflation" there. we're keeping it. π)
here's the list of valid options:
-WindowBitsβ to uncompress an RFC 1950 data stream, setWindowBitsto a positive number. to uncompress an RFC 1951 data stream, setWindowBitsto-MAX_WBITS. for the full definition of the meaning and valid values forWindowBits, refer to the zlib documentation for inflateInit2. defaults toMAX_WBITS.-Bufsizeβ sets the initial size for the inflation buffer. if the buffer has to be reallocated to increase the size, it grows in increments ofBufsize. default is4096.-Dictionaryβ the default is no dictionary.
here's an example of using the inflateInit optional parameter to override the default buffer size: β¨
inflateInit( -Bufsize => 300 ) ;
π¦ ($out, $status) = $i->inflate($buffer)
inflates the complete contents of $buffer. the buffer can be either a scalar or a scalar reference.
returns Z_OK if successful, and Z_STREAM_END if the end of the compressed data has been successfully reached. if it's not successful, $out will be undef and $status will hold the zlib error code. β
the $buffer parameter gets modified by inflate. on completion it'll contain whatever remains of the input buffer after inflation. meaning: $buffer will be an empty string when the return status is Z_OK. and when the return status is Z_STREAM_END, the $buffer parameter contains whatever (if anything) was stored in the input buffer after the deflated data stream.
this feature is genuinely so useful when you're processing a file format that encapsulates a compressed data stream (e.g. gzip, zip). ate. π
π $status = $i->inflateSync($buffer)
scans $buffer until it hits either a full flush point or the end of the buffer.
if a full flush point is found, Z_OK is returned and $buffer will have all the data up to the flush point removed. you can then pass that to the deflate method.
any other return code means a flush point was not found. if there's more data available, inflateSync can be called repeatedly with more compressed data until the flush point turns up. π
π $i->dict_adler()
returns the adler32 value for the dictionary.
π $i->msg()
returns the last error message generated by zlib.
π $i->total_in()
returns the total number of bytes compressed bytes input to inflate.
π $i->total_out()
returns the total number of uncompressed bytes output from inflate.
π Example
here's an example of using inflate: π«Ά
use strict ;
use warnings ;
use Compress::Zlib ;
my $x = inflateInit()
or die "Cannot create a inflation stream\n" ;
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 ;
}
die "inflation failed\n"
unless $status == Z_STREAM_END ;
π CHECKSUM FUNCTIONS π
Bestie, zlib provides two functions to calculate checksums, and the Perl interface has reversed the order of the two parameters in both of them. Why? So you can do running checksums and one-off calculations. Iconic.
$crc = adler32($buffer [,$crc]) ;
$crc = crc32($buffer [,$crc]) ;
The $buffer parameters can either be a scalar or a scalar reference β both are valid, no cap.
If the $crc parameter is "undef", the crc value will be reset. Slay.
If you have built this module with zlib 1.2.3 or better, two more CRC-related functions are available:
$crc = crc32_combine($crc1, $crc2, $len2);
$adler = adler32_combine($adler1, $adler2, $len2);
These functions allow checksums to be merged π«Ά. Refer to the zlib documentation for more details.
π§ Misc π§
πΈ my $version = Compress::Zlib::zlib_version(); πΈ
Returns the version of the zlib library. Thatβs it. Cute and useful.
β¨ CONSTANTS β¨
All the zlib constants are automatically imported when you make use of Compress::Zlib. Free constants, no extra import ceremony π
.
π¦ SUPPORT π¦
General feedback/questions/bug reports should be sent to https://github.com/pmqs/IO-Compress/issues (preferred) or https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress.
π SEE ALSO π
Go peek at these besties:
IO::Compress::Gzip,IO::Uncompress::Gunzip,IO::Compress::Deflate,IO::Uncompress::Inflate,IO::Compress::RawDeflate,IO::Uncompress::RawInflate,IO::Compress::Bzip2,IO::Uncompress::Bunzip2,IO::Compress::Lzma,IO::Uncompress::UnLzma,IO::Compress::Xz,IO::Uncompress::UnXz,IO::Compress::Lzip,IO::Uncompress::UnLzip,IO::Compress::Lzop,IO::Uncompress::UnLzop,IO::Compress::Lzf,IO::Uncompress::UnLzf,IO::Compress::Zstd,IO::Uncompress::UnZstd,IO::Uncompress::AnyInflate,IO::Uncompress::AnyUncompressIO::Compress::FAQFile::GlobMapper,Archive::Zip,Archive::Tar,IO::Zlib
For RFC 1950, 1951 and 1952 see https://datatracker.ietf.org/doc/html/rfc1950, https://datatracker.ietf.org/doc/html/rfc1951 and https://datatracker.ietf.org/doc/html/rfc1952.
The zlib compression library was written by Jean-loup Gailly "gzip@prep.ai.mit.edu" and Mark Adler "madler@alumni.caltech.edu".
The primary site for the zlib compression library is http://www.zlib.org.
The primary site for the zlib-ng compression library is https://github.com/zlib-ng/zlib-ng.
The primary site for gzip is http://www.gzip.org.
π AUTHOR π
This module was written by Paul Marquess, "pmqs@cpan.org".
π MODIFICATION HISTORY π
See the Changes file.
π COPYRIGHT AND LICENSE π
Copyright (c) 1995-2026 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Thatβs the whole Compress::Zlib(3pm) page, bestie π β source/version perl v5.42.3, dated 2026-11-03. Go forth and compress, periodt β¨
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms