Compress::Zlib(3perl)
π NAME π
Compress::Zlib β bestie, it's the Perl interface to the zlib compression library β¨
β¨ 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 π¦
So Compress::Zlib is the module that gives Perl a whole interface to the zlib compression library β and if you're wondering where to even get zlib, the "AUTHOR" section has the deets π
Here's the vibe: Compress::Zlib splits into two big areas of functionality:
- a simple read/write interface to gzip files π
- a low-level in-memory compression/decompression interface β¨
We're gonna walk through both of them in the sections coming up, no cap π«Ά
πΈ Notes for users of Compress::Zlib version 1 πΈ
Biggest glow-up in Compress::Zlib version 2.x: it doesn't talk straight to the zlib library anymore π Instead it uses the IO::Compress::Gzip and IO::Uncompress::Gunzip modules for reading and writing gzip files, and the Compress::Raw::Zlib module for some low-level zlib access π
Good news though: the interface version 2 hands you should be 100% backward compatible with version 1 π₯ And if you find a difference in the expected behaviour, bestie, please contact the author (look at "AUTHOR"). Also go read "GZIP INTERFACE" π
Now, with the creation of the IO::Compress and IO::Uncompress modules, there are no new features planned for Compress::Zlib π The new modules do literally everything Compress::Zlib does and then some. Development on Compress::Zlib will be limited to bug fixes only, periodt.
So if you're writing new code, your first port of call should be one of the new IO::Compress or IO::Uncompress modules π«Ά
π GZIP INTERFACE π
zlib ships a bunch of functions for reading and writing gzip files that conform to RFC 1952, and this module gives you an interface to most of them β¨
If you've previously used Compress::Zlib 1.x, here's what got enhanced/changed in the gzopen interface π
- If you want to open either STDIN or STDOUT with
gzopen, 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. That made things especially tricky when a Perl filehandle got passed togzopenβ behind the scenes the numeric C file descriptor had to be extracted from the Perl filehandle and then 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's 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 already-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, specifies whether the file is opened for reading or writing and lets you 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$sizebytes from the compressed file into$buffer. If$sizeis not specified, it defaults to4096. If the scalar$bufferisn't large enough, it gets 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$bufferto the compressed file. Returns the number of bytes actually written, or0on 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 gets 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 thezlibdocumentation for details π
Returns 0 on success.
$offset = $gz->gztell() ;β Returns the uncompressed file offset πΈ$status = $gz->gzseek($offset, $whence) ;β Provides a sub-set of theseekfunctionality, 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 gets 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 are0through9,Z_NO_COMPRESSION,Z_BEST_SPEED,Z_BEST_COMPRESSION, andZ_DEFAULT_COMPRESSIONπ₯$strategyβ Defines the strategy used to tune the compression. The valid values areZ_DEFAULT_STRATEGY,Z_FILTEREDandZ_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$gzerrnoscalar holds the error code associated with the most recent gzip routine πΈ Note that unlike gzerror(), the error is not associated with a particular file π
So real talk about <code>$gzerrno</code>: just like <code>gzerror()</code>, it gives you an error number when you use it in numeric context, and an error message when you use it in string context. But unlike <code>gzerror()</code>, that error message is the zlib message when the error is a zlib thing, or the UNIX error message when it's not (i.e. when zlib returned <code>"Z_ERRORNO"</code>).
And because zlib error numbers and UNIX error numbers overlap, <code>$gzerrno</code> should only be used to check for the presence of an error in numeric context. Use <code>gzerror()</code> if you want to check for specific zlib errors. The <code>gzcat</code> example below shows how to use the variable safely. π
Examples π
Okay bestie, here's a whole little script that uses the interface. It implements a <code>gzcat</code> function:
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() ;
}
And below is a script that makes use of <code>"gzreadline"</code>. It's basically a super simple <code>grep</code>-like script:
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, <code>gzstream</code>, does the exact opposite of the <code>gzcat</code> script above. It reads from standard input and writes a gzip data stream to standard output:
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, no cap):
$dest = Compress::Zlib::memGzip($buffer)
or die "Cannot compress: $gzerrno\n";
If it succeeds, it returns the in-memory gzip file. If not, it returns <code>"undef"</code> and the <code>$gzerrno</code> variable will store the zlib error code.
The <code>$buffer</code> parameter can either be a scalar or a scalar reference.
See <code>IO::Compress::Gzip</code> 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 it succeeds, it returns the uncompressed gzip file. If not, it returns <code>"undef"</code> and the <code>$gzerrno</code> variable will store the zlib error code.
The <code>$buffer</code> parameter can either be a scalar or a scalar reference. The contents of the <code>$buffer</code> parameter are destroyed after calling this function. π
Heads up: if <code>$buffer</code> consists of multiple concatenated gzip data streams, only the first will be uncompressed. Use <code>"gunzip"</code> with the <code>"MultiStream"</code> option in the <code>"IO::Uncompress::Gunzip"</code> module if you need to deal with concatenated data streams.
See <code>IO::Uncompress::Gunzip</code> 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 <code>"compress"</code> and <code>"uncompress"</code>.
$dest = compress($source [, $level] ) ;
- Compresses <code>$source</code>. If successful it returns the compressed data. Otherwise it returns <code>undef</code>.
- The source buffer, <code>$source</code>, can either be a scalar or a scalar reference.
- The <code>$level</code> parameter defines the compression level. Valid values are <code>0</code> through <code>9</code>, <code>"Z_NO_COMPRESSION"</code>, <code>"Z_BEST_SPEED"</code>, <code>"Z_BEST_COMPRESSION"</code>, and <code>"Z_DEFAULT_COMPRESSION"</code>. If <code>$level</code> is not specified <code>"Z_DEFAULT_COMPRESSION"</code> will be used.
$dest = uncompress($source) ;
- Uncompresses <code>$source</code>. If successful it returns the uncompressed data. Otherwise it returns <code>undef</code>.
- 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 <code>IO::Deflate</code> and <code>IO::Inflate</code> included with this distribution for an alternative interface for reading/writing RFC 1950 files/buffers.
β¨ Deflate Interface β¨
okay so this section is where the spicy stuff lives π
β it defines an interface that lets you do in-memory compression using the deflate interface that zlib gives us. no file handles needed, just vibes and buffers.
here's the whole interface laid out for you, bestie π«Ά
π ($d, $status) = deflateInit( [OPT] )
this one initialises a deflation stream β¨. it's the glow-up moment for your data.
lowkey iconic detail: it combines the features of three zlib functions all at once β deflateInit, deflateInit2 and deflateSetDictionary. three-for-one, we love to see it π
if it works, you get back the initialised deflation stream $d and a $status of Z_OK, but only in a list context. in scalar context? it just hands you the deflation stream $d and nothing else. main character behaviour honestly π
if it doesn't work, the deflation stream $d comes back as undef and $status holds the exact zlib error code. no sugarcoating, fr fr.
this function optionally takes a bunch of named options written as -Name=>value pairs, so you can tweak just the ones you care about instead of listing every single one. and for backward compatibility, you can also pass the parameters as a reference to a hash holding the name=>value pairs. flexible queen π
so: the function takes one optional parameter β a reference to a hash β and the contents of that hash let you tailor the deflation interface. here's every valid option, no skips:
-Levelβ sets the compression level. valid values are0through9,Z_NO_COMPRESSION,Z_BEST_SPEED,Z_BEST_COMPRESSION, andZ_DEFAULT_COMPRESSION. the default isZ_DEFAULT_COMPRESSION.-Methodβ sets the compression method. the only valid value at present (and also the default) isZ_DEFLATED.-WindowBitsβ wanna create an RFC 1950 data stream? setWindowBitsto a positive number β¨. wanna create an RFC 1951 data stream instead? setWindowBitsto-MAX_WBITS. for the full definition of what it means and which values are valid forWindowBits, go read the zlib documentation fordeflateInit2. it defaults toMAX_WBITS.-MemLevelβ for the meaning and the valid values ofMemLevel, check the zlib documentation fordeflateInit2. defaults toMAX_MEM_LEVEL.-Strategyβ sets the strategy used to tune the compression. valid values areZ_DEFAULT_STRATEGY,Z_FILTEREDandZ_HUFFMAN_ONLY. the default isZ_DEFAULT_STRATEGY.-Dictionaryβ when a dictionary is specified,Compress::Zlibwill automatically calldeflateSetDictionaryright after it callsdeflateInit. and the Adler32 value for that dictionary? you grab it 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 grow bigger, it grows in increments ofBufsize. the default is4096.
here's an example of using the deflateInit optional parameter list to override the default buffer size and the compression level. every other option just takes its default value, she's low maintenance:
deflateInit( -Bufsize => 300,
-Level => Z_BEST_SPEED ) ;
π ($out, $status) = $d->deflate($buffer)
this deflates whatever's inside $buffer. the buffer can be either a scalar or a scalar reference, both are valid. when it's finished, $buffer will be completely processed (assuming there were no errors, obviously π). if the deflation went well you get back the deflated output $out plus a status value $status of Z_OK.
on error, $out is undef and $status holds the zlib error code. sad but informative.
in a scalar context, deflate returns $out only.
β οΈ heads up bestie: just like thedeflatefunction in zlib itself, it is not necessarily the case that any output will be produced by this method. so do not rely on$outbeing empty as an error test. that's a trap, i'm telling you π
πΈ ($out, $status) = $d->flush() / ($out, $status) = $d->flush($flush_type)
typically used to finish the deflation. any pending output comes back through $out, and $status will have the value Z_OK if it worked β¨
in a scalar context, flush returns $out only.
π¨ okay real talk: flushing can seriously degrade the compression ratio. so only use it to terminate a decompression (that's withZ_FINISH) or when you actually want to create a full flush point (that's withZ_FULL_FLUSH). periodt.
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. and it is strongly recommended that you only set the flush_type parameter if you fully understand the implications of what it does. go read the zlib documentation for the details, iykyk π
π¦ $status = $d->deflateParams([OPT])
changes the settings for the deflate stream $d. a little mid-stream makeover π
here's the list of valid options. anything you don't specify just stays unchanged, no drama:
-Levelβ sets the compression level. valid values are0through9,Z_NO_COMPRESSION,Z_BEST_SPEED,Z_BEST_COMPRESSION, andZ_DEFAULT_COMPRESSION.-Strategyβ sets the strategy used to tune the compression. the 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 that zlib generated.
π« $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 just reads standard input, deflates it, and writes it to standard output. baby's first deflate, and it ate π₯
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 π
and now the reverse β¨ this section defines the interface available that lets you do in-memory uncompression using the deflate interface provided by zlib. (yes, it says deflate interface, that's literally what the original says, i'm just the messenger π«Ά)
here's the definition of the interface:
π ($i, $status) = inflateInit()
this initialises an inflation stream β puffing it right back up πΈ
in a list context it returns the inflation stream $i and the zlib status code in $status. in a scalar context it returns the inflation stream only.
if it's successful, $i holds the inflation stream and $status will be Z_OK β¨
if it's not successful, $i will be undef and $status will hold the zlib error code.
this function optionally takes a bunch of named options written as -Name=>value pairs, so you can tweak individual options without having to specify them all in the parameter list. and for backward compatibility, it's also possible to 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 β and the contents of that hash let the interface be tailored. here's every valid option:
-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 the valid values forWindowBits, refer to the zlib documentation forinflateInit2. it defaults toMAX_WBITS.-Bufsizeβ sets the initial size for the inflation buffer. if the buffer has to be reallocated to increase the size, it will grow in increments ofBufsize. the 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 it's 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 will contain whatever remains of the input buffer after inflation. which means: $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 will contain what (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 β think gzip, zip. obsessed with it actually π«Ά
π¦ $status = $i->inflateSync($buffer)
scans $buffer until it reaches 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. that can then be passed 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 is found. keep going bestie, you'll get there π
π« $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 π
ok so zlib hands you two lil checksum calculators, and for the Perl interface the two parameters in both of them got flipped around compared to the C originals. why do we care? because this way you can do a running checksum and a one-off calculation with the same function. bestie that's range, that's versatility π
$crc = adler32($buffer [,$crc]) ;
$crc = crc32($buffer [,$crc]) ;
The $buffer parameters can either be a scalar or a scalar reference. either one, no drama.
If the $crc parameter is undef, the crc value will be reset. like, wiped, fresh start, blank slate energy.
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 (iykyk β we're not gonna out-explain zlib here).
π«Ά Misc π«Ά
my $version = Compress::Zlib::zlib_version();
Returns the version of the zlib library. that's it, that's the whole function. iconic minimalism β
β¨ CONSTANTS β¨
All the zlib constants are automatically imported when you make use of Compress::Zlib. no use gymnastics, no extra lines, they just show up. queen behavior π
πΈ 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>.
fr fr, they prefer the GitHub one. go there first bestie π«Ά
π SEE ALSO π
ok so this is a LOT of friends, buckle up:
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 sacred texts π
The zlib compression library was written by Jean-loup Gailly "gzip@prep.ai.mit.edu" and Mark Adler "madler@alumni.caltech.edu". legends, honestly π
- 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. absolute main character energy, we stan π
π¦ MODIFICATION HISTORY π¦
See the Changes file. (the receipts are in there β¨)
π 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.
and that's a wrap on the whole page bestie!! πβ¨ go forth and compress responsibly π«Ά this was perl v5.44.0, dated 2026-10-17, filed under Compress::Zlib(3perl) β mwah, no cap π
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms