Bzip2(3)

NAME
Compress::Bzip2 - Interface to Bzip2 compression library

SYNOPSIS
    use Compress::Bzip2;
    $dest = Compress::Bzip2::compress($source, [$level]);
    $dest = Compress::Bzip2::decompress($source, [$ratio]);

DESCRIPTION
The Compress::Bzip2 module provides a Perl interface to the Bzip2 compression library (see the AUTHOR entry elsewhere in this document for details about where to get Bzip2). A relevant subset of the functionality provided by Bzip2 is available in Compress::Bzip2.

All string parameters can either be a scalar or a scalar reference.

COMPRESSION FUNCTIONS
$dest = Compress::Bzip2::compress($string)

Compress a string using the default compression level, returning a string containing compressed data.

$dest = Compress::Bzip2::compress($string, $level)

Compress string, using the chosen compression level (either 1 or 9). Return a string containing the compressed data.

On error undef is returned.

DECOMPRESSION FUNCTIONS
$dest = Compress::Bzip2::decompress($string, $ratio)

Decompress the data in string, returning a string containing the decompressed data. Ratio is the amount of space reserved, by default we reseve 20x the length of string for decompressing. If you have a better than 20:1 compression ratio, then you'll need to increase ratio.

On error undef is returned.

AUTHOR
The Compress::Bzip2 module was written by Gawdi Azem azemgi@rupert.informatik.uni-stuttgart.de, Brian Horakh brian@zoovy.com.

MODIFICATION HISTORY
1.00 First public release of Compress::Bzip2. 1.10 Re-released to be compatible with new libbz
        added ratio to decompress