IO::Co...::Gzip(3perl)
πΈ IO::Compress::Gzip π
okay bestie, welcome to the IO::Compress::Gzip(3perl) page from the Perl Programmers Reference Guide β¨ it's a lot of words but it's SO worth it, this module is the moment, it's the blueprint, it's lowkey the whole gzip situation. hydrate, sit down, we're doing this π«Ά
β¨ NAME β¨
IO::Compress::Gzip β Write RFC 1952 files/buffers. that's the whole job description, iconic π
β¨ SYNOPSIS β¨
use IO::Compress::Gzip qw(gzip $GzipError) ;
my $status = gzip $input => $output [,OPTS]
or die "gzip failed: $GzipError\n";
my $z = IO::Compress::Gzip->new( $output [,OPTS] )
or die "gzip failed: $GzipError\n";
$z->print($string);
$z->printf($format, $string);
$z->write($string);
$z->syswrite($string [, $length, $offset]);
$z->flush();
$z->tell();
$z->eof();
$z->seek($position, $whence);
$z->binmode();
$z->fileno();
$z->opened();
$z->autoflush();
$z->input_line_number();
$z->newStream( [OPTS] );
$z->deflateParams();
$z->close() ;
$GzipError ;
# IO::File mode
print $z $string;
printf $z $format, $string;
tell $z
eof $z
seek $z, $position, $whence
binmode $z
fileno $z
close $z ;
β¨ DESCRIPTION β¨
so like, this module hands you a Perl interface that lets you write compressed data to files or buffers exactly the way RFC 1952 says to. periodt.
and every single gzip header that RFC 1952 defines? you can create all of them with this module. all of them. no notes π₯
now, if you're trying to read RFC 1952 files/buffers instead of write them, you want the companion module IO::Uncompress::Gunzip β that's its bestie, not its twin π
π« Functional Interface π«
there's a top-level function called gzip that does the "one-shot" compression thing between buffers and/or files. it's giving effortless. but if you want finer control over the compression process, go look at the "OO Interface" section instead π
use IO::Compress::Gzip qw(gzip $GzipError) ;
gzip $input_filename_or_reference => $output_filename_or_reference [,OPTS]
or die "gzip failed: $GzipError\n";
fr fr, this functional interface needs Perl5.005 or better. no old-school Perls allowed, sorry not sorry π
gzip $input_filename_or_reference => $output_filename_or_reference [, OPTS]
gzip wants at least two parameters β $input_filename_or_reference and $output_filename_or_reference β plus zero or more optional parameters (those live in "Optional Parameters").
π The $input_filename_or_reference parameter π
this parameter is the one that defines where the uncompressed data comes from. it can show up in any of these forms:
- A filename β if
$input_filename_or_referenceis a simple scalar, it's assumed to be a filename. that file gets opened for reading and the input data gets read out of it. simple, clean, slay. - A filehandle β if
$input_filename_or_referenceis a filehandle, the input data is read from it. the string'-'can be used as an alias for standard input πΈ - A scalar reference β if
$input_filename_or_referenceis a scalar reference, the input data is read from$$input_filename_or_reference. - An array reference β if
$input_filename_or_referenceis an array reference, every element in that array has to be a filename.
the input data gets read from each file, in turn.
and the complete array gets walked first to make sure it only contains valid filenames, all of that before any data is compressed. it checks before it wrecks π
- An Input FileGlob string β if
$input_filename_or_referenceis a string delimited by the characters<and>,gzipis gonna assume it's an input fileglob string. the input is then the list of files that match the fileglob.
see File::GlobMapper for more details π
if $input_filename_or_reference is any other type? undef gets returned. that's it, that's the whole answer π
and one more thing bestie: if $input_filename_or_reference is a simple filename, the default values for the "Name" and "Time" options get sourced from that file.
if you are NOT about those defaults, you can override them by explicitly setting the "Name" and "Time" options β or by setting the "Minimal" parameter. your call, main character π
π¦ The $output_filename_or_reference parameter π¦
$output_filename_or_reference is the one that controls where the compressed data goes. it can take one of these forms:
- A filename β if
$output_filename_or_referenceis a simple scalar, it's assumed to be a filename. this file gets opened for writing and the compressed data gets written into it. - A filehandle β if
$output_filename_or_referenceis a filehandle, the compressed data gets written to it. the string'-'can be used as an alias for standard output β¨ - A scalar reference β if
$output_filename_or_referenceis a scalar reference, the compressed data gets stored in$$output_filename_or_reference. - An Array Reference β if
$output_filename_or_referenceis an array reference, the compressed data gets pushed onto the array. - An Output FileGlob β if
$output_filename_or_referenceis a string delimited by the characters<and>,gzipis gonna assume it's an output fileglob string. the output is the list of files that match the fileglob.
heads up bestie: when$output_filename_or_referenceis a fileglob string, then$input_filename_or_referencemust also be a fileglob string. anything else is an error, no exceptions π
see File::GlobMapper for more details π
if $output_filename_or_reference is any other type, undef gets returned. again. it's a whole thing.
π Notes π
when $input_filename_or_reference maps to multiple files/buffers and $output_filename_or_reference is a single file/buffer, those input files/buffers get stored in $output_filename_or_reference as a concatenated series of compressed data streams. stack 'em, don't crack 'em π«Ά
π Optional Parameters π
the optional parameters for the one-shot function gzip are (for the most part) identical to the ones used with the OO interface over in the "Constructor Options" section. the exceptions are listed below π
"AutoClose => 0|1"β this option applies to any input or output data streams handed togzipthat are filehandles.
if "AutoClose" is specified and the value is true, it results in all input and/or output filehandles being closed once gzip has completed.
this parameter defaults to 0.
"BinModeIn => 0|1"β this option is now a no-op. all files will be read in binmode. it said what it said π"Append => 0|1"β the behaviour of this option depends on the type of output data stream, so let's break it all the way down:- A Buffer β if
"Append"is enabled, all compressed data gets appended to the end of the output buffer. otherwise the output buffer gets cleared before any compressed data is written to it. - A Filename β if
"Append"is enabled, the file is opened in append mode. otherwise the contents of the file, if there are any, get truncated before any compressed data is written to it. - A Filehandle β if
"Append"is enabled, the filehandle gets positioned to the end of the file via a call to"seek"before any compressed data is written to it. otherwise the file pointer doesn't get moved at all.
- A Buffer β if
when "Append" is specified and set to true, it appends all compressed data to the output data stream.
so: when the output is a filehandle, it carries out a seek to the eof before writing any compressed data. when the output is a filename, it gets opened for appending. when the output is a buffer, all compressed data gets appended to the existing buffer. all roads lead to appending β¨
conversely, when "Append" is not specified β or it's present and set to false β it operates like this instead:
when the output is a filename, it truncates the contents of the file before writing any compressed data. when the output is a filehandle, its position is not changed. when the output is a buffer, it gets wiped before any compressed data is output.
defaults to 0.
π Oneshot Examples π
here are a few examples showing off what this module can actually do. brace yourself, it's cute.
Streaming
this very simple command line example demonstrates the streaming capabilities of the module. the code reads data from STDIN, compresses it, and writes the compressed data to STDOUT.
$ echo hello world | perl -MIO::Compress::Gzip=gzip -e 'gzip \*STDIN => \*STDOUT' >output.gz
the special filename "-" can be used as a standin for both "\*STDIN" and "\*STDOUT", so the above can be rewritten as
$ echo hello world | perl -MIO::Compress::Gzip=gzip -e 'gzip "-" => "-"' >output.gz
Compressing a file from the filesystem
to read the contents of the file "file1.txt" and write the compressed data to the file "file1.txt.gz":
use strict ;
use warnings ;
use IO::Compress::Gzip qw(gzip $GzipError) ;
my $input = "file1.txt";
gzip $input => "$input.gz"
or die "gzip failed: $GzipError\n";
Reading from a Filehandle and writing to an in-memory buffer
to read from an existing Perl filehandle, $input, and write the compressed data to a buffer, $buffer:
use strict ;
use warnings ;
use IO::Compress::Gzip qw(gzip $GzipError) ;
use IO::File ;
my $input = IO::File->new( "<file1.txt" )
or die "Cannot open 'file1.txt': $!\n" ;
my $buffer ;
gzip $input => \$buffer
or die "gzip failed: $GzipError\n";
Compressing multiple files
to compress all files in the directory "/my/home" that match "*.txt" and store the compressed data in the same directory:
use strict ;
use warnings ;
use IO::Compress::Gzip qw(gzip $GzipError) ;
gzip '</my/home/*.txt>' => '<*.gz>'
or die "gzip failed: $GzipError\n";
and if you want to compress each file one at a time, this will do the trick:
use strict ;
use warnings ;
use IO::Compress::Gzip qw(gzip $GzipError) ;
for my $input ( glob "/my/home/*.txt" )
{
my $output = "$input.gz" ;
gzip $input => $output
or die "Error compressing '$input': $GzipError\n";
}
π OO Interface π
π Constructor π
the format of the constructor for IO::Compress::Gzip is shown below:
my $z = IO::Compress::Gzip->new( $output [,OPTS] )
or die "IO::Compress::Gzip failed: $GzipError\n";
the constructor takes one mandatory parameter, $output (defined below), and zero or more "OPTS", which are defined over in "Constructor Options".
it returns an "IO::Compress::Gzip" object on success and undef on failure. and the variable $GzipError will contain an error message on failure, so you always know what went down πβ¨
okay so that's the setup, the vibe, the whole blueprint β the options themselves are a whole other saga and we are NOT done yet, stay with me πΈ
If you're on Perl 5.005 or newer, the object $z that IO::Compress::Gzip hands you back can be used exactly like an IO::File filehandle. Like, literally every normal output file operation works on $z π. So if you wanna write to a compressed file or buffer, both of these hit:
$z->print("hello world\n");
print $z "hello world\n";
Here's a lil baby example of the OO interface creating an output file "myfile.gz" and tossing some data at it:
my $filename = "myfile.gz";
my $z = IO::Compress::Gzip->new($filename)
or die "IO::Compress::Gzip failed: $GzipError\n";
$z->print("abcde");
$z->close();
Wanna see more? Go peep the "Examples" section π
So the mandatory parameter $output β that's the thing that decides where your compressed data actually lands. It can be one of these flavors:
- A filename β if
$outputis just a plain scalar, it's treated as a filename. The file gets opened for writing and all the compressed data gets written into it. Simple as that. - A filehandle β if
$outputis a filehandle, the compressed data goes there. Oh and you can totally use the string'-'as an alias for standard output π«Ά - A scalar reference β if
$outputis a scalar reference, the compressed data gets stored in$$output. Iconic.
And if $output is literally any other type? Then IO::Compress::Gzip::new just returns undef. Yeah. Sorry bestie π
β¨ Constructor Options β¨
OPTS is any combo of zero or more of these bad boys:
AutoClose => 0|1β only valid when$outputis a filehandle. If you set it and the value is true,$outputgets closed once either theclosemethod is called or theIO::Compress::Gzipobject gets destroyed. Defaults to 0.Append => 0|1β opens$outputin append mode. What that actually means depends on what$outputis:- A Buffer β if
$outputis a buffer andAppendis on, all compressed data gets appended to the end of$output. Otherwise$outputgets cleared before anything is written to it. - A Filename β if
$outputis a filename andAppendis on, the file opens in append mode. Otherwise the file's contents (if it even had any) get truncated before any compressed data is written. - A Filehandle β if
$outputis a filehandle, the file pointer gets moved to the end of the file via aseekcall before any compressed data is written. Otherwise the file pointer stays put.
- A Buffer β if
Defaults to 0.
Merge => 0|1β this one's for compressing input data and appending it onto an existing compressed data stream in$output. End result? One single compressed data stream living in$output. Cute.
Heads up: it's a fatal error to try this option when $output isn't an RFC 1952 data stream. No cap.
And there's more drama β the Merge option comes with limitations:
- This module has to have been built with zlib 1.2.1 or better for it to work. Use
Mergewith an older zlib and you get a fatal error thrown at you. - If
$outputis a file or a filehandle, it must be seekable.
Defaults to 0.
-Levelβ sets the compression level zlib uses. Value should be a number between 0 and 9 (0 = no compression, 9 = maximum compression), or one of the symbolic constants below:
Z_NO_COMPRESSION
Z_BEST_SPEED
Z_BEST_COMPRESSION
Z_DEFAULT_COMPRESSION
Default is Z_DEFAULT_COMPRESSION.
Oh, and quick note β these constants are not imported by IO::Compress::Gzip by default. You gotta ask nicely:
use IO::Compress::Gzip qw(:strategy);
use IO::Compress::Gzip qw(:constants);
use IO::Compress::Gzip qw(:all);
-Strategyβ sets the strategy used to tune the compression. Pick one of these symbolic constants:
Z_FILTERED
Z_HUFFMAN_ONLY
Z_RLE
Z_FIXED
Z_DEFAULT_STRATEGY
Default is Z_DEFAULT_STRATEGY.
Minimal => 0|1β turn this on and it forces the creation of the smallest possible compliant gzip header (which is exactly 10 bytes long, fr), as defined in RFC 1952.
Wanna know what values go in which header fields? Check out the section titled "Compliance" in RFC 1952.
Also, if this is set to 1, all the other parameters that control what's in the gzip header get ignored. Sorry to them.
Defaults to 0.
Comment => $commentβ stashes the contents of$commentinto the COMMENT field of the gzip header. By default, no comment field gets written to the gzip file at all.
If -Strict is enabled, the comment can only be ISO 8859-1 characters plus line feed.
If -Strict is disabled, the comment field can hold any character except NULL. And if any null characters show up? The field gets truncated at the first NULL. Boom.
Name => $stringβ stashes$stringinto the gzip NAME header field. IfNameisn't specified, no gzip NAME field gets created.
If -Strict is enabled, $string can only be ISO 8859-1 characters.
If -Strict is disabled, $string can hold any character except NULL. Same deal as before: null characters mean the field gets truncated at the first NULL.
Time => $numberβ sets the MTIME field in the gzip header to$number.
If you don't specify this option, the field defaults to the time the IO::Compress::Gzip object was created.
TextFlag => 0|1β controls the FLG.FTEXT bit in the gzip header. That bit is basically a lil signal saying "hey, the data in this gzip file/buffer is probably text."
Default is 0.
HeaderCRC => 0|1β when it's true, this sets the FLG.FHCRC bit to 1 in the gzip header and sets the CRC16 header field to the CRC of the entire gzip header except the CRC16 field itself.
Real talk though: gzip files created with HeaderCRC set to 1 cannot be read by most β if not all β of the standard gunzip utilities, most notably gzip version 1.2.4. So if you want your gzip files to be as portable as possible, avoid this option. Please π
Defaults to 0.
OS_Code => $valueβ stores$valuein the gzip OS header field. Any number between 0 and 255 is valid.
If you don't specify it, this defaults to the OS code of the Operating System this module was built on. Fun fact: the value 3 is the catch-all for all Unix variants and unknown Operating Systems. Slay.
ExtraField => $dataβ this lets you stash extra metadata in the ExtraField of the gzip header. An RFC 1952 compliant ExtraField is made of zero or more subfields, and each subfield is a two byte header followed by the subfield data.
You can hand over the list of subfields in any of these formats:
-ExtraField => [$id1, $data1,
$id2, $data2,
...
]
-ExtraField => [ [$id1 => $data1],
[$id2 => $data2],
...
]
-ExtraField => { $id1 => $data1,
$id2 => $data2,
...
}
Where $id1, $id2 are two byte subfield ID's. The second byte of the ID can't be 0 β unless you've disabled the Strict option.
If you go with the hash syntax, just know you have zero control over the order the ExtraSubFields get stored in, plus you can't have SubFields with duplicate IDs. Trade-offs, bestie.
Alternatively you can hand over the list of subfields as a scalar, like this:
-ExtraField => $rawdata
If you use the raw format and Strict is enabled, IO::Compress::Gzip will check that $rawdata consists of zero or more conformant sub-fields. When Strict is disabled, $rawdata can be any arbitrary byte stream you want.
The maximum size of the Extra Field is 65535 bytes.
ExtraFlags => $valueβ sets the XFL byte in the gzip header to$value.
If this option isn't present, the value stored in the XFL field gets determined by whatever the Level option is set to:
- If
Level => Z_BEST_SPEEDwas specified, XFL is set to 2. - If
Level => Z_BEST_COMPRESSIONwas specified, XFL is set to 4. - Otherwise, XFL is set to 0.
Strict => 0|1βStrictoptionally polices the values you supply with the other options, making sure they're compliant with RFC1952. It's enabled by default, btw.
When Strict is enabled, all this behaviour gets policed:
- The value given with the
Nameoption can only contain ISO 8859-1 characters. - The value given with the
Commentoption can only contain ISO 8859-1 characters plus line-feed. - The values given with the
-Nameand-Commentoptions can't contain multiple embedded nulls. - If an
ExtraFieldoption is specified and it's a simple scalar, it must conform to the sub-field structure defined in RFC 1952. - If an
ExtraFieldoption is specified, the second byte of the ID gets checked in every subfield to make sure it doesn't hold the reserved value0x00.
When Strict is disabled, all this behaviour gets policed:
- The value given with the
-Nameoption can contain any character except NULL. - The value given with the
-Commentoption can contain any character except NULL. - The values given with the
-Nameand-Commentoptions can contain multiple embedded nulls. The string written to the gzip header will consist of the characters up to β but not including β the first embedded NULL. - If an
ExtraFieldoption is specified and it's a simple scalar, the structure won't be checked at all. The only error you'll get is if the length is too big.
- The ID header in an
ExtraFieldsub-field can consist of any two bytes. No cap, literally any two. π²
π Examples π
π Streaming π
This super simple command line example is showing off the streaming glow-up of the module. The code reads data from STDIN β or all the files you hand it on the commandline, bestie β compresses it, and writes the compressed data right out to STDOUT. Chef's kiss. π©βπ³π
use strict ;
use warnings ;
use IO::Compress::Gzip qw(gzip $GzipError) ;
my $z = IO::Compress::Gzip->new("-", Stream => 1)
or die "IO::Compress::Gzip failed: $GzipError\n";
while (<>) {
$z->print("abcde");
}
$z->close();
Not the use of "-" to mean "STDOUT". Alternatively you can use "\*STDOUT". Both are giving. β¨
π Compressing a file from the filesystem π
So you wanna read the contents of the file file1.txt and write the compressed data to the file file1.txt.gz? Iconic. There are a few options here, and here's the vibe:
Start by creating the compression object and opening the input file π«Ά
use strict ;
use warnings ;
use IO::Compress::Gzip qw(gzip $GzipError) ;
my $input = "file1.txt";
my $z = IO::Compress::Gzip->new("file1.txt.gz")
or die "IO::Compress::Gzip failed: $GzipError\n";
# open the input file
open my $fh, "<", "file1.txt"
or die "Cannot open file1.txt: $!\n";
# loop through the input file & write to the compressed file
while (<$fh>) {
$z->print($_);
}
# not forgetting to close the compressed file
$z->close();
π οΈ Methods π οΈ
β¨ print β¨
Usage is
$z->print($data)
print $z $data
Compresses and outputs the contents of the $data parameter. Same behaviour as the built-in print, fr fr.
Returns true if it worked. π
β¨ printf β¨
Usage is
$z->printf($format, $data)
printf $z $format, $data
Compresses and outputs the contents of the $data parameter.
Returns true if it worked. π
β¨ syswrite β¨
Usage is
$z->syswrite $data
$z->syswrite $data, $length
$z->syswrite $data, $length, $offset
Compresses and outputs the contents of the $data parameter.
Returns the number of uncompressed bytes written, or undef if it flops. π
β¨ write β¨
Usage is
$z->write $data
$z->write $data, $length
$z->write $data, $length, $offset
Compresses and outputs the contents of the $data parameter.
Returns the number of uncompressed bytes written, or undef if it flops. π
β¨ flush β¨
Usage is
$z->flush;
$z->flush($flush_type);
Flushes any pending compressed data out to the output file/buffer. Poosh it out. π¨
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. Now listen bestie β it is strongly recommended that you only set the flush_type parameter if you fully, completely understand the implications of what it does, because overuse of flush can seriously degrade the level of compression you achieve. Don't do it just for fun. π See the zlib documentation for the details.
Returns true on success. πΈ
β¨ tell β¨
Usage is
$z->tell()
tell $z
Returns the uncompressed file offset. π
β¨ eof β¨
Usage is
$z->eof();
eof($z);
Returns true if the close method has been called.
β¨ seek β¨
$z->seek($position, $whence);
seek($z, $position, $whence);
Provides a sub-set of the seek functionality, with the restriction that it is only legal to seek forward in the output file/buffer. Attempting to seek backward is a fatal error. Periodt. π«
Empty parts of the file/buffer will have NULL (0x00) bytes written to them.
The $whence parameter takes one of the usual values, namely SEEK_SET, SEEK_CUR or SEEK_END.
Returns 1 on success, 0 on failure.
β¨ binmode β¨
Usage is
$z->binmode
binmode $z ;
This is a noop, provided purely for completeness. It's giving "I'm just here so I don't get fined". π
β¨ opened β¨
$z->opened()
Returns true if the object currently refers to an opened file/buffer.
β¨ autoflush β¨
my $prev = $z->autoflush()
my $prev = $z->autoflush(EXPR)
If the $z object is associated with a file or a filehandle, this method returns the current autoflush setting for the underlying filehandle. If EXPR is present, and is non-zero, it will enable flushing after every write/print operation.
If $z is associated with a buffer, this method has no effect and always returns undef.
Heads up bestie: the special variable $| can not be used to set or retrieve the autoflush setting. Literally cannot. π
β¨ input_line_number β¨
$z->input_line_number()
$z->input_line_number(EXPR)
This method always returns undef when compressing. Always. Every time. π«
β¨ fileno β¨
$z->fileno()
fileno($z)
If the $z object is associated with a file or a filehandle, fileno will return the underlying file descriptor. Once the close method has been called, fileno will return undef.
If the $z object is associated with a buffer, this method will return undef.
β¨ close β¨
$z->close() ;
close $z ;
Flushes any pending compressed data and then closes the output file/buffer. Bye bye π
For most versions of Perl this method will be automatically invoked if the IO::Compress::Gzip object is destroyed (either explicitly, or by the variable with the reference to the object going out of scope). The exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In these cases, the close method will be called automatically, but not until global destruction of all live objects when the program is terminating. Yeah. Scary.
So therefore, if you want your scripts to be able to run on all versions of Perl, you should call close explicitly and not rely on automatic closing. Do the responsible thing, bestie. π«Ά
Returns true on success, otherwise 0.
If the AutoClose option has been enabled when the IO::Compress::Gzip object was created, and the object is associated with a file, the underlying file will also be closed.
β¨ newStream([OPTS]) β¨
Usage is
$z->newStream( [OPTS] )
Closes the current compressed data stream and starts a new one. Fresh start energy. π
OPTS consists of any of the options that are available when creating the $z object.
See the "Constructor Options" section for more details.
β¨ deflateParams β¨
Usage is
$z->deflateParams
TODO. That's it. That's the documentation. π
π¦ Importing π¦
A number of symbolic constants are required by some methods in "IO::Compress::Gzip". None are imported by default.
:allβ Importsgzip,$GzipErrorand all symbolic constants that can be used by"IO::Compress::Gzip". Same as doing this:
use IO::Compress::Gzip qw(gzip $GzipError :constants) ;
:constantsβ Import all symbolic constants. Same as doing this:
use IO::Compress::Gzip qw(:flush :level :strategy) ;
:flushβ These symbolic constants are used by theflushmethod.
Z_NO_FLUSH
Z_PARTIAL_FLUSH
Z_SYNC_FLUSH
Z_FULL_FLUSH
Z_FINISH
Z_BLOCK
:levelβ These symbolic constants are used by theLeveloption in the constructor.
Z_NO_COMPRESSION
Z_BEST_SPEED
Z_BEST_COMPRESSION
Z_DEFAULT_COMPRESSION
:strategyβ These symbolic constants are used by theStrategyoption in the constructor.
Z_FILTERED
Z_HUFFMAN_ONLY
Z_RLE
Z_FIXED
Z_DEFAULT_STRATEGY
π EXAMPLES π
π§ Apache::GZip Revisited π§
See IO::Compress::FAQ
π Working with Net::FTP π
See IO::Compress::FAQ
π«Ά SUPPORT π«Ά
General feedback / questions / bug reports should be sent to <https://github.com/pmqs/IO-Copress/issues> (preferred, bestie) or <https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Copress>.
π SEE ALSO π
Compress::Zlib, 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::AnyUncompress
IO::Compress::FAQ
File::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". Absolute legends. π
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". We stan. π
π MODIFICATION HISTORY π
See the Changes file.
βοΈ COPYRIGHT AND LICENSE βοΈ
Copyright (c) 2005-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 bestie!! π¦β¨ this page is from perl v5.44.0, dated 2026-10-17, and it's the IO::Compress::Gzip(3perl) manpage β go forth and compress, you gorgeous main character ππ
π¦ 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