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 compression, using Compress::Zlib. The zlib library must be available on your machine.

Don't forget to flush.

Changing compression parameters

On write, compression level and strategy default to the defaults specified in Compress::Zlib. To hack these, set

$PerlIO::via::gzip::COMPRESSION_LEVEL

to a digit between 0 (fastest) and 9 (best), and

$PerlIO::via::gzip::COMPRESSION_STRATEGY

to 'f' for filtered data, 'h' for Huffman-only compression, or 'R' for run-length encoding, per Compress::Zlib.

SEE ALSO

PerlIO, PerlIO::via, Compress::Zlib

AUTHOR - Mark A. Jensen

Email maj -at- fortinbras -dot- us
http://fortinbras.us
http://bioperl.org/wiki/Mark_Jensen