Mark Allen Jensen > PerlIO-via-gzip-0.021 > PerlIO::via::gzip

Download:
PerlIO-via-gzip-0.021.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.021   Source  

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- fortinbras -dot- us
 http://fortinbras.us
 http://bioperl.org/wiki/Mark_Jensen
syntax highlighting: