PerlIO::via::gzip - PerlIO layer for gzip (de)compression
# compress open( $cfh, ">:via(gzip)", 'stdout.gz' ); print $cfh @stuff; # decompress open( $fh, "<:via(gzip)", "stuff.gz" ); while (<$fh>) { ... }
This module provides a PerlIO layer for transparent gzip de/compression, using IO::Compress::Gzip and IO::Uncompress::Gunzip.
On write, compression level and strategy default to the defaults specified in IO::Compress::Gzip. To hack these, set
$PerlIO::via::gzip::COMPRESSION_LEVEL
and
$PerlIO::via::gzip::COMPRESSION_STRATEGY
to the desired constants, as imported from IO::Compress::Gzip.
When a PerlIO::via::gzip write handle is flushed, the underlying IO::Compress::Gzip handle is flushed and closed. This appears to be necessary for getting a valid gzip file when a PerlIO::via::gzip write handle is closed. See comment in the FLUSH source.
PerlIO::via::gzip
PerlIO, PerlIO::via, IO::Compress::Gzip, IO::Uncompress::Gunzip
Email maj -at- cpan -dot- org http://fortinbras.us
To install PerlIO::via::gzip, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PerlIO::via::gzip
CPAN shell
perl -MCPAN -e shell install PerlIO::via::gzip
For more information on module installation, please visit the detailed CPAN module installation guide.