IO::Uncompress::Inflate - Read RFC 1950 files/buffers
use IO::Uncompress::Inflate qw(inflate $InflateError) ;
my $status = inflate $input => $output [,OPTS]
or die "inflate failed: $InflateError\n";
my $z = new IO::Uncompress::Inflate $input [OPTS]
or die "inflate failed: $InflateError\n";
$status = $z->read($buffer)
$status = $z->read($buffer, $length)
$status = $z->read($buffer, $length, $offset)
$line = $z->getline()
$char = $z->getc()
$char = $z->ungetc()
$char = $z->opened()
$status = $z->inflateSync()
$data = $z->trailingData()
$status = $z->nextStream()
$data = $z->getHeaderInfo()
$z->tell()
$z->seek($position, $whence)
$z->binmode()
$z->fileno()
$z->eof()
$z->close()
$InflateError ;
# IO::File mode
<$z>
read($z, $buffer);
read($z, $buffer, $length);
read($z, $buffer, $length, $offset);
tell($z)
seek($z, $position, $whence)
binmode($z)
fileno($z)
eof($z)
close($z)
This module provides a Perl interface that allows the reading of files/buffers that conform to RFC 1950.
For writing RFC 1950 files/buffers, see the companion module IO::Compress::Deflate.
A top-level function, inflate
, is provided to carry out "one-shot" uncompression between buffers and/or files. For finer control over the uncompression process, see the "OO Interface" section.
use IO::Uncompress::Inflate qw(inflate $InflateError) ;
inflate $input_filename_or_reference => $output_filename_or_reference [,OPTS]
or die "inflate failed: $InflateError\n";
The functional interface needs Perl5.005 or better.
inflate
expects at least two parameters, $input_filename_or_reference
and $output_filename_or_reference
.
$input_filename_or_reference
parameterThe parameter, $input_filename_or_reference
, is used to define the source of the compressed data.
It can take one of the following forms:
If the <$input_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for reading and the input data will be read from it.
If the $input_filename_or_reference
parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input.
If $input_filename_or_reference
is a scalar reference, the input data will be read from $$input_filename_or_reference
.
If $input_filename_or_reference
is an array reference, each element in the array must be a filename.
The input data will be read from each file in turn.
The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed.
If $input_filename_or_reference
is a string that is delimited by the characters "<" and ">" inflate
will assume that it is an input fileglob string. The input is the list of files that match the fileglob.
See File::GlobMapper for more details.
If the $input_filename_or_reference
parameter is any other type, undef
will be returned.
$output_filename_or_reference
parameterThe parameter $output_filename_or_reference
is used to control the destination of the uncompressed data. This parameter can take one of these forms.
If the $output_filename_or_reference
parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it.
If the $output_filename_or_reference
parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output.
If $output_filename_or_reference
is a scalar reference, the uncompressed data will be stored in $$output_filename_or_reference
.
If $output_filename_or_reference
is an array reference, the uncompressed data will be pushed onto the array.