NAME

PerlIO::via::gzip - PerlIO layer for gzip (de)compression

SYNOPSIS

# compress
open( $cfh, ">:via(gzip)", 'stdout.gz' );
print $cfh @stuff;

# decompress
open( $fh, "<:via(gzip)", "stuff.gz" );
while (<$fh>) {
   ...
}

DESCRIPTION

This module provides a PerlIO layer for transparent gzip de/compression, using IO::Compress::Gzip and IO::Uncompress::Gunzip.

Changing compression parameters

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.

NOTE

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.

SEE ALSO

PerlIO, PerlIO::via, IO::Compress::Gzip, IO::Uncompress::Gunzip

AUTHOR - Mark A. Jensen

Email maj -at- cpan -dot- org
http://fortinbras.us