From 729f45d7bf3b2bb45c58073d57074aa8ba1feb6d Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Tue, 3 Jul 2018 09:06:01 +0100 Subject: Upgrade IO-Compress from version 2.074 to 2.081 --- cpan/IO-Compress/lib/Compress/Zlib.pm | 72 ++++----- cpan/IO-Compress/lib/File/GlobMapper.pm | 52 +++--- cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm | 6 +- .../IO-Compress/lib/IO/Compress/Adapter/Deflate.pm | 6 +- .../lib/IO/Compress/Adapter/Identity.pm | 4 +- cpan/IO-Compress/lib/IO/Compress/Base.pm | 134 +++++++-------- cpan/IO-Compress/lib/IO/Compress/Base/Common.pm | 180 ++++++++++----------- cpan/IO-Compress/lib/IO/Compress/Bzip2.pm | 86 +++++----- cpan/IO-Compress/lib/IO/Compress/Deflate.pm | 97 ++++++----- cpan/IO-Compress/lib/IO/Compress/FAQ.pod | 44 ++--- cpan/IO-Compress/lib/IO/Compress/Gzip.pm | 121 +++++++------- cpan/IO-Compress/lib/IO/Compress/Gzip/Constants.pm | 2 +- cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm | 99 ++++++------ cpan/IO-Compress/lib/IO/Compress/Zip.pm | 147 ++++++++--------- cpan/IO-Compress/lib/IO/Compress/Zip/Constants.pm | 2 +- cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm | 2 +- cpan/IO-Compress/lib/IO/Compress/Zlib/Extra.pm | 4 +- .../lib/IO/Uncompress/Adapter/Bunzip2.pm | 6 +- .../lib/IO/Uncompress/Adapter/Identity.pm | 6 +- .../lib/IO/Uncompress/Adapter/Inflate.pm | 6 +- cpan/IO-Compress/lib/IO/Uncompress/AnyInflate.pm | 84 +++++----- .../IO-Compress/lib/IO/Uncompress/AnyUncompress.pm | 102 ++++++------ cpan/IO-Compress/lib/IO/Uncompress/Base.pm | 17 +- cpan/IO-Compress/lib/IO/Uncompress/Bunzip2.pm | 70 ++++---- cpan/IO-Compress/lib/IO/Uncompress/Gunzip.pm | 76 ++++----- cpan/IO-Compress/lib/IO/Uncompress/Inflate.pm | 70 ++++---- cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm | 72 ++++----- cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm | 80 ++++----- 28 files changed, 814 insertions(+), 833 deletions(-) (limited to 'cpan/IO-Compress/lib') diff --git a/cpan/IO-Compress/lib/Compress/Zlib.pm b/cpan/IO-Compress/lib/Compress/Zlib.pm index 86da8340ff..36b224f526 100644 --- a/cpan/IO-Compress/lib/Compress/Zlib.pm +++ b/cpan/IO-Compress/lib/Compress/Zlib.pm @@ -7,17 +7,17 @@ use Carp ; use IO::Handle ; use Scalar::Util qw(dualvar); -use IO::Compress::Base::Common 2.074 ; -use Compress::Raw::Zlib 2.074 ; -use IO::Compress::Gzip 2.074 ; -use IO::Uncompress::Gunzip 2.074 ; +use IO::Compress::Base::Common 2.081 ; +use Compress::Raw::Zlib 2.081 ; +use IO::Compress::Gzip 2.081 ; +use IO::Uncompress::Gunzip 2.081 ; use strict ; use warnings ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); -$VERSION = '2.074'; +$VERSION = '2.081'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -461,7 +461,7 @@ sub inflate package Compress::Zlib ; -use IO::Compress::Gzip::Constants 2.074 ; +use IO::Compress::Gzip::Constants 2.081 ; sub memGzip($) { @@ -662,7 +662,7 @@ Compress::Zlib - Interface to zlib compression library $status = $gz->gzclose() ; $status = $gz->gzeof() ; $status = $gz->gzsetparams($level, $strategy) ; - $errstring = $gz->gzerror() ; + $errstring = $gz->gzerror() ; $gzerrno $dest = Compress::Zlib::memGzip($buffer) ; @@ -680,7 +680,7 @@ Compress::Zlib - Interface to zlib compression library The I module provides a Perl interface to the I compression library (see L for details about where to get -I). +I). The C module can be split into two general areas of functionality, namely a simple read/write interface to I files @@ -694,11 +694,11 @@ The main change in C version 2.x is that it does not now interface directly to the zlib library. Instead it uses the C and C modules for reading/writing gzip files, and the C module for some -low-level zlib access. +low-level zlib access. The interface provided by version 2 of this module should be 100% backward compatible with version 1. If you find a difference in the expected -behaviour please contact the author (See L). See L +behaviour please contact the author (See L). See L With the creation of the C and C modules no new features are planned for C - the new modules do @@ -712,7 +712,7 @@ new C or C modules. A number of functions are supplied in I for reading and writing I files that conform to RFC 1952. This module provides an interface -to most of them. +to most of them. If you have previously used C 1.x, the following enhancements/changes have been made to the C interface: @@ -725,7 +725,7 @@ If you want to open either STDIN or STDOUT with C, you can now optionally use the special filename "C<->" as a synonym for C<\*STDIN> and C<\*STDOUT>. -=item 2 +=item 2 In C version 1.x, C used the zlib library to open the underlying file. This made things especially tricky when a Perl @@ -736,7 +736,7 @@ the zlib library. Apart from being non-portable to some operating systems, this made it difficult to use C in situations where you wanted to extract/create a gzip data stream that is embedded in a larger file, without having to -resort to opening and closing the file multiple times. +resort to opening and closing the file multiple times. It also made it impossible to pass a perl filehandle that wasn't associated with a real filesystem file, like, say, an C. @@ -768,7 +768,7 @@ L for more details. =item B<$gz = gzopen($filehandle, $mode)> This function opens either the I file C<$filename> for reading or -writing or attaches to the opened filehandle, C<$filehandle>. +writing or attaches to the opened filehandle, C<$filehandle>. It returns an object on success and C on failure. When writing a gzip file this interface will I create the smallest @@ -812,7 +812,7 @@ the case of an error, -1. =item B<$bytesread = $gz-Egzreadline($line) ;> -Reads the next line from the compressed file into C<$line>. +Reads the next line from the compressed file into C<$line>. Returns the number of bytes actually read. On EOF it returns 0 and in the case of an error, -1. @@ -821,7 +821,7 @@ It is legal to intermix calls to C and C. To maintain backward compatibility with version 1.x of this module C ignores the C<$/> variable - it I uses the string -C<"\n"> as the line delimiter. +C<"\n"> as the line delimiter. If you want to read a gzip file a line at a time and have it respect the C<$/> variable (or C<$INPUT_RECORD_SEPARATOR>, or C<$RS> when C is @@ -891,7 +891,7 @@ C. =item B<$strategy> Defines the strategy used to tune the compression. The valid values are -C, C and C. +C, C and C. =back @@ -947,12 +947,12 @@ I function. foreach my $file (@ARGV) { my $buffer ; - my $gz = gzopen($file, "rb") + my $gz = gzopen($file, "rb") or die "Cannot open $file: $gzerrno\n" ; print $buffer while $gz->gzread($buffer) > 0 ; - die "Error reading from $file: $gzerrno" . ($gzerrno+0) . "\n" + die "Error reading from $file: $gzerrno" . ($gzerrno+0) . "\n" if $gzerrno != Z_STREAM_END ; $gz->gzclose() ; @@ -975,14 +975,14 @@ very simple I like script. @ARGV = '-' unless @ARGV ; foreach my $file (@ARGV) { - my $gz = gzopen($file, "rb") + my $gz = gzopen($file, "rb") or die "Cannot open $file: $gzerrno\n" ; while ($gz->gzreadline($_) > 0) { print if /$pattern/ ; } - die "Error reading from $file: $gzerrno\n" + die "Error reading from $file: $gzerrno\n" if $gzerrno != Z_STREAM_END ; $gz->gzclose() ; @@ -1003,7 +1003,7 @@ standard output. or die "Cannot open stdout: $gzerrno\n" ; while (<>) { - $gz->gzwrite($_) + $gz->gzwrite($_) or die "error writing: $gzerrno\n" ; } @@ -1014,7 +1014,7 @@ standard output. This function is used to create an in-memory gzip file with the minimum possible gzip header (exactly 10 bytes). - $dest = Compress::Zlib::memGzip($buffer) + $dest = Compress::Zlib::memGzip($buffer) or die "Cannot compress: $gzerrno\n"; If successful, it returns the in-memory gzip file. Otherwise it returns @@ -1029,7 +1029,7 @@ carry out in-memory gzip compression. This function is used to uncompress an in-memory gzip file. - $dest = Compress::Zlib::memGunzip($buffer) + $dest = Compress::Zlib::memGunzip($buffer) or die "Cannot uncompress: $gzerrno\n"; If successful, it returns the uncompressed gzip file. Otherwise it @@ -1092,7 +1092,7 @@ Here is a definition of the interface available: =head2 B<($d, $status) = deflateInit( [OPT] )> -Initialises a deflation stream. +Initialises a deflation stream. It combines the features of the I functions C, C and C. @@ -1152,7 +1152,7 @@ Defaults to MAX_MEM_LEVEL. =item B<-Strategy> Defines the strategy used to tune the compression. The valid values are -C, C and C. +C, C and C. The default is Z_DEFAULT_STRATEGY. @@ -1160,7 +1160,7 @@ The default is Z_DEFAULT_STRATEGY. When a dictionary is specified I will automatically call C directly after calling C. The -Adler32 value for the dictionary can be obtained by calling the method +Adler32 value for the dictionary can be obtained by calling the method C<$d->dict_adler()>. The default is no dictionary. @@ -1179,7 +1179,7 @@ Here is an example of using the C optional parameter list to override the default buffer size and compression level. All other options will take their default values. - deflateInit( -Bufsize => 300, + deflateInit( -Bufsize => 300, -Level => Z_BEST_SPEED ) ; =head2 B<($out, $status) = $d-Edeflate($buffer)> @@ -1236,7 +1236,7 @@ C. =item B<-Strategy> Defines the strategy used to tune the compression. The valid values are -C, C and C. +C, C and C. =back @@ -1298,7 +1298,7 @@ Here is a definition of the interface: =head2 B<($i, $status) = inflateInit()> -Initialises an inflation stream. +Initialises an inflation stream. In a list context it returns the inflation stream, C<$i>, and the I status code in C<$status>. In a scalar context it returns the @@ -1339,7 +1339,7 @@ Defaults to MAX_WBITS. Sets the initial size for the inflation buffer. If the buffer has to be reallocated to increase the size, it will grow in increments of -C. +C. Default is 4096. @@ -1360,7 +1360,7 @@ Inflates the complete contents of C<$buffer>. The buffer can either be a scalar or a scalar reference. Returns C if successful and C if the end of the -compressed data has been successfully reached. +compressed data has been successfully reached. If not successful, C<$out> will be I and C<$status> will hold the I error code. @@ -1424,7 +1424,7 @@ Here is an example of using C. { ($output, $status) = $x->inflate(\$input) ; - print $output + print $output if $status == Z_OK or $status == Z_STREAM_END ; last if $status != Z_OK ; @@ -1477,7 +1477,7 @@ L, L, L, L -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L, L and L @@ -1492,7 +1492,7 @@ The primary site for gzip is L. =head1 AUTHOR -This module was written by Paul Marquess, C. +This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY @@ -1500,7 +1500,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 1995-2017 Paul Marquess. All rights reserved. +Copyright (c) 1995-2018 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/IO-Compress/lib/File/GlobMapper.pm b/cpan/IO-Compress/lib/File/GlobMapper.pm index a96cf3e832..a4e5385565 100644 --- a/cpan/IO-Compress/lib/File/GlobMapper.pm +++ b/cpan/IO-Compress/lib/File/GlobMapper.pm @@ -9,24 +9,24 @@ our ($CSH_GLOB); BEGIN { if ($] < 5.006) - { + { require File::BSDGlob; import File::BSDGlob qw(:glob) ; $CSH_GLOB = File::BSDGlob::GLOB_CSH() ; *globber = \&File::BSDGlob::csh_glob; - } + } else - { + { require File::Glob; import File::Glob qw(:glob) ; $CSH_GLOB = File::Glob::GLOB_CSH() ; #*globber = \&File::Glob::bsd_glob; *globber = \&File::Glob::csh_glob; - } + } } our ($Error); our ($VERSION, @EXPORT_OK); -$VERSION = '1.000'; +$VERSION = '1.001'; @EXPORT_OK = qw( globmap ); @@ -44,7 +44,7 @@ $matchMetaRE = '[' . quotemeta($metachars) . ']'; ')' => ')', ); -%wildCount = map { $_ => 1 } qw/ * ? . { ( [ /; +%wildCount = map { $_ => 1 } qw/ * ? . { ( [ /; sub globmap ($$;) { @@ -88,7 +88,7 @@ sub new $self->_parseOutputGlob() or return undef ; - + my @inputFiles = globber($self->{InputGlob}, $flags) ; if (GLOB_ERROR) @@ -148,18 +148,18 @@ sub _parseBit ++ $self->{WildCount} if $wildCount{$2} ; if ($2 eq ',') - { + { return _unmatched("(") if $depth ; - + $out .= '|'; } elsif ($2 eq '(') - { + { ++ $depth ; } elsif ($2 eq ')') - { + { return _unmatched(")") if ! $depth ; @@ -214,11 +214,11 @@ sub _parseInputGlob ++ $self->{WildCount} if $wildCount{$2} ; if ($2 eq '(') - { + { ++ $depth ; } elsif ($2 eq ')') - { + { return _unmatched(")") if ! $depth ; @@ -252,8 +252,8 @@ sub _parseInputGlob } #$string =~ s#(.*?)\}##; - #my $alt = join '|', - # map { quotemeta $_ } + #my $alt = join '|', + # map { quotemeta $_ } # split "$noPreBS,", $1 ; my $alt = $self->_parseBit($1); defined $alt or return 0 ; @@ -426,7 +426,7 @@ Below is a possible implementation of a script to carry out the rename my $new = $old; $new =~ s#(.*)\.tar\.gz$#$1.tgz# ; - rename $old => $new + rename $old => $new or die "Cannot rename '$old' to '$new': $!\n; } @@ -439,14 +439,14 @@ has already done a lot of the hard work in pattern matching the filenames, wouldn't it be handy to be able to use the patterns in the fileglob to drive the new filename? -Well, that's I what C does. +Well, that's I what C does. Here is same snippet of code rewritten using C for my $pair (globmap '<*.tar.gz>' => '<#1.tgz>' ) { my ($from, $to) = @$pair; - rename $from => $to + rename $from => $to or die "Cannot rename '$old' to '$new': $!\n; } @@ -454,7 +454,7 @@ So how does it work? Behind the scenes the C function does a combination of a file glob to match existing filenames followed by a substitute -to create the new filenames. +to create the new filenames. Notice how both parameters to C are strings that are delimited by <>. This is done to make them look more like file globs - it is just syntactic @@ -463,7 +463,7 @@ distinctive. The enclosing <> are optional, so you don't have to use them - in fact the first thing globmap will do is remove these delimiters if they are present. -The first parameter to C, C<*.tar.gz>, is an I. +The first parameter to C, C<*.tar.gz>, is an I. Once the enclosing "< ... >" is removed, this is passed (more or less) unchanged to C to carry out a file match. @@ -472,7 +472,7 @@ full Perl regular expression, with the additional step of wrapping each transformed wildcard metacharacter sequence in parenthesis. In this case the input fileglob C<*.tar.gz> will be transformed into -this Perl regular expression +this Perl regular expression ([^/]*)\.tar\.gz @@ -598,9 +598,9 @@ filename matched by the input file glob. So *.c *.Z -The second is +The second is -Output FileGlobs take the +Output FileGlobs take the =over 5 @@ -610,7 +610,7 @@ The "*" character will be replaced with the complete input filename. =item #1 -Patterns of the form /#\d/ will be replaced with the +Patterns of the form /#\d/ will be replaced with the =back @@ -645,7 +645,7 @@ source and destination filenames. Here is an example that renames all c files to cpp. - + $ rename '*.c' '#1.cpp' =head2 A few example globmaps @@ -656,7 +656,7 @@ To copy all your .c file to a backup directory '' '' -If you want to compress all +If you want to compress all '' '<*.gz>' diff --git a/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm b/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm index 99773e8160..7b30c60138 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm @@ -4,12 +4,12 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.074 qw(:Status); +use IO::Compress::Base::Common 2.081 qw(:Status); -use Compress::Raw::Bzip2 2.074 ; +use Compress::Raw::Bzip2 2.081 ; our ($VERSION); -$VERSION = '2.074'; +$VERSION = '2.081'; sub mkCompObject { diff --git a/cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm b/cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm index 1edd3fa62a..463c0e1b15 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Adapter/Deflate.pm @@ -4,13 +4,13 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.074 qw(:Status); -use Compress::Raw::Zlib 2.074 qw( !crc32 !adler32 ) ; +use IO::Compress::Base::Common 2.081 qw(:Status); +use Compress::Raw::Zlib 2.081 qw( !crc32 !adler32 ) ; require Exporter; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, @EXPORT, %DEFLATE_CONSTANTS); -$VERSION = '2.074'; +$VERSION = '2.081'; @ISA = qw(Exporter); @EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS; %EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS; diff --git a/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm b/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm index 71dee011ff..92bc093338 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Adapter/Identity.pm @@ -4,10 +4,10 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.074 qw(:Status); +use IO::Compress::Base::Common 2.081 qw(:Status); our ($VERSION); -$VERSION = '2.074'; +$VERSION = '2.081'; sub mkCompObject { diff --git a/cpan/IO-Compress/lib/IO/Compress/Base.pm b/cpan/IO-Compress/lib/IO/Compress/Base.pm index 74eac6fba6..2f009966db 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Base.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Base.pm @@ -6,7 +6,7 @@ require 5.006 ; use strict ; use warnings; -use IO::Compress::Base::Common 2.074 ; +use IO::Compress::Base::Common 2.081 ; use IO::File (); ; use Scalar::Util (); @@ -20,7 +20,7 @@ use Symbol(); our (@ISA, $VERSION); @ISA = qw(IO::File Exporter); -$VERSION = '2.074'; +$VERSION = '2.081'; #Can't locate object method "SWASHNEW" via package "utf8" (perhaps you forgot to load "utf8"?) at .../ext/Compress-Zlib/Gzip/blib/lib/Compress/Zlib/Common.pm line 16. @@ -90,7 +90,7 @@ sub writeAt if (defined *$self->{FH}) { my $here = tell(*$self->{FH}); - return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) + return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) if $here < 0 ; seek(*$self->{FH}, $offset, IO::Handle::SEEK_SET) or return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) ; @@ -120,7 +120,7 @@ sub output my $data = shift ; my $last = shift ; - return 1 + return 1 if length $data == 0 && ! $last ; if ( *$self->{FilterContainer} ) { @@ -131,7 +131,7 @@ sub output if (length $data) { if ( defined *$self->{FH} ) { defined *$self->{FH}->write( $data, length $data ) - or return $self->saveErrorString(0, $!, $!); + or return $self->saveErrorString(0, $!, $!); } else { ${ *$self->{Buffer} } .= $data ; @@ -157,7 +157,7 @@ our %PARAMS = ( 'filtercontainer' => [IO::Compress::Base::Common::Parse_code, undef], ); - + sub checkParams { my $self = shift ; @@ -171,9 +171,9 @@ sub checkParams $self->getExtraParams(), - *$self->{OneShot} ? $self->getOneShotParams() + *$self->{OneShot} ? $self->getOneShotParams() : (), - }, + }, @_) or $self->croakError("${class}: " . $got->getError()) ; return $got ; @@ -237,15 +237,15 @@ sub _create $obj->ckParams($got) or $obj->croakError("${class}: " . $obj->error()); - if ($got->getValue('encode')) { + if ($got->getValue('encode')) { my $want_encoding = $got->getValue('encode'); *$obj->{Encoding} = IO::Compress::Base::Common::getEncoding($obj, $class, $want_encoding); - my $x = *$obj->{Encoding}; + my $x = *$obj->{Encoding}; } else { - *$obj->{Encoding} = undef; + *$obj->{Encoding} = undef; } - + $obj->saveStatus(STATUS_OK) ; my $status ; @@ -253,7 +253,7 @@ sub _create { *$obj->{Compress} = $obj->mkComp($got) or return undef; - + *$obj->{UnCompSize} = new U64 ; *$obj->{CompSize} = new U64 ; @@ -274,14 +274,14 @@ sub _create } } - elsif ($outType eq 'filename') { + elsif ($outType eq 'filename') { no warnings; my $mode = '>' ; $mode = '>>' if $appendOutput; - *$obj->{FH} = new IO::File "$mode $outValue" + *$obj->{FH} = new IO::File "$mode $outValue" or return $obj->saveErrorString(undef, "cannot open file '$outValue': $!", $!) ; - *$obj->{StdIO} = ($outValue eq '-'); + *$obj->{StdIO} = ($outValue eq '-'); setBinModeOutput(*$obj->{FH}) ; } } @@ -307,7 +307,7 @@ sub _create return $obj ; } -sub ckOutputParam +sub ckOutputParam { my $self = shift ; my $from = shift ; @@ -321,15 +321,15 @@ sub ckOutputParam $self->croakError("$from: output buffer is read-only") if $outType eq 'buffer' && Scalar::Util::readonly(${ $_[0] }); - - return 1; + + return 1; } sub _def { my $obj = shift ; - + my $class= (caller)[0] ; my $name = (caller(1))[3] ; @@ -356,7 +356,7 @@ sub _def # { # while (my($k, $v) = each %$input) # { -# $v = \$input->{$k} +# $v = \$input->{$k} # unless defined $v ; # # $obj->_singleTarget($x, 1, $k, $v, @_) @@ -381,11 +381,11 @@ sub _def if (! $x->{oneOutput} ) { - my $inFile = ($x->{inType} eq 'filenames' + my $inFile = ($x->{inType} eq 'filenames' || $x->{inType} eq 'filename'); $x->{inType} = $inFile ? 'filename' : 'buffer'; - + foreach my $in ($x->{oneInput} ? $input : @$input) { my $out ; @@ -416,7 +416,7 @@ sub _singleTarget my $x = shift ; my $inputIsFilename = shift; my $input = shift; - + if ($x->{oneInput}) { $obj->getFileInfo($x->{Got}, $input) @@ -426,7 +426,7 @@ sub _singleTarget or return undef ; - defined $z->_wr2($input, $inputIsFilename) + defined $z->_wr2($input, $inputIsFilename) or return $z->closeError(undef) ; return $z->close() ; @@ -456,7 +456,7 @@ sub _singleTarget or return undef ; } - defined $obj->_wr2($element, $isFilename) + defined $obj->_wr2($element, $isFilename) or return $obj->closeError(undef) ; *$obj->{Got} = $keep->clone(); @@ -476,7 +476,7 @@ sub _wr2 my $input = $source ; if (! $inputIsFilename) { - $input = \$source + $input = \$source if ! ref $source; } @@ -503,16 +503,16 @@ sub _wr2 my $count = 0 ; while ($status = read($fh, $buff, 16 * 1024)) { $count += length $buff; - defined $self->syswrite($buff, @_) + defined $self->syswrite($buff, @_) or return undef ; } - return $self->saveErrorString(undef, $!, $!) + return $self->saveErrorString(undef, $!, $!) if ! defined $status ; if ( (!$isFilehandle || *$self->{AutoClose}) && $input ne '-') - { - $fh->close() + { + $fh->close() or return undef ; } @@ -555,7 +555,7 @@ sub TIEHANDLE return $_[0] if ref($_[0]); die "OOPS\n" ; } - + sub UNTIE { my $self = shift ; @@ -565,10 +565,10 @@ sub DESTROY { my $self = shift ; local ($., $@, $!, $^E, $?); - + $self->close() ; - # TODO - memory leak with 5.8.0 - this isn't called until + # TODO - memory leak with 5.8.0 - this isn't called until # global destruction # %{ *$self } = () ; @@ -603,7 +603,7 @@ sub syswrite if (@_ > 2) { $offset = $_[2] || 0; - $self->croakError(*$self->{ClassName} . "::write: offset outside string") + $self->croakError(*$self->{ClassName} . "::write: offset outside string") if $offset > $slen; if ($offset < 0) { $offset += $slen; @@ -617,20 +617,20 @@ sub syswrite } return 0 if (! defined $$buffer || length $$buffer == 0) && ! *$self->{FlushPending}; - + # *$self->{Pending} .= $$buffer ; -# +# # return length $$buffer # if (length *$self->{Pending} < 1024 * 16 && ! *$self->{FlushPending}) ; # -# $$buffer = *$self->{Pending} ; +# $$buffer = *$self->{Pending} ; # *$self->{Pending} = ''; - - if (*$self->{Encoding}) { + + if (*$self->{Encoding}) { $$buffer = *$self->{Encoding}->encode($$buffer); } else { - $] >= 5.008 and ( utf8::downgrade($$buffer, 1) + $] >= 5.008 and ( utf8::downgrade($$buffer, 1) or Carp::croak "Wide character in " . *$self->{ClassName} . "::write:"); } @@ -642,7 +642,7 @@ sub syswrite my $outBuffer=''; my $status = *$self->{Compress}->compr($buffer, $outBuffer) ; - return $self->saveErrorString(undef, *$self->{Compress}{Error}, + return $self->saveErrorString(undef, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo}) if $status == STATUS_ERROR; @@ -690,7 +690,7 @@ sub _flushCompressed my $outBuffer=''; my $status = *$self->{Compress}->flush($outBuffer, @_) ; - return $self->saveErrorString(0, *$self->{Compress}{Error}, + return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo}) if $status == STATUS_ERROR; @@ -702,19 +702,19 @@ sub _flushCompressed $self->outputPayload($outBuffer) or return 0; - return 1; + return 1; } sub flush -{ +{ my $self = shift ; $self->_flushCompressed(@_) - or return 0; + or return 0; if ( defined *$self->{FH} ) { defined *$self->{FH}->flush() - or return $self->saveErrorString(0, $!, $!); + or return $self->saveErrorString(0, $!, $!); } return 1; @@ -737,21 +737,21 @@ sub _newStream $self->ckParams($got) or $self->croakError("newStream: $self->{Error}"); - if ($got->getValue('encode')) { + if ($got->getValue('encode')) { my $want_encoding = $got->getValue('encode'); *$self->{Encoding} = IO::Compress::Base::Common::getEncoding($self, $class, $want_encoding); } else { *$self->{Encoding} = undef; } - + *$self->{Compress} = $self->mkComp($got) or return 0; *$self->{Header} = $self->mkHeader($got) ; $self->output(*$self->{Header} ) or return 0; - + *$self->{UnCompSize}->reset(); *$self->{CompSize}->reset(); @@ -763,9 +763,9 @@ sub _newStream sub newStream { my $self = shift ; - + my $got = $self->checkParams('newStream', *$self->{Got}, @_) - or return 0 ; + or return 0 ; $self->_newStream($got); @@ -775,7 +775,7 @@ sub newStream # *$self->{Header} = $self->mkHeader($got) ; # $self->output(*$self->{Header} ) # or return 0; -# +# # *$self->{UnCompSize}->reset(); # *$self->{CompSize}->reset(); # @@ -822,7 +822,7 @@ sub close return 1 if *$self->{Closed} || ! *$self->{Compress} ; *$self->{Closed} = 1 ; - untie *$self + untie *$self if $] >= 5.008 ; *$self->{FlushPending} = 1 ; @@ -840,7 +840,7 @@ sub close if ((! *$self->{Handle} || *$self->{AutoClose}) && ! *$self->{StdIO}) { $! = 0 ; *$self->{FH}->close() - or return $self->saveErrorString(0, $!, $!); + or return $self->saveErrorString(0, $!, $!); } delete *$self->{FH} ; # This delete can set $! in older Perls, so reset the errno @@ -924,7 +924,7 @@ sub seek } # short circuit if seeking to current offset - return 1 if $target == $here ; + return 1 if $target == $here ; # Outlaw any attempt to seek backwards $self->croakError(*$self->{ClassName} . "::seek: cannot seek backwards") @@ -944,16 +944,16 @@ sub binmode { 1; # my $self = shift ; -# return defined *$self->{FH} -# ? binmode *$self->{FH} +# return defined *$self->{FH} +# ? binmode *$self->{FH} # : 1 ; } sub fileno { my $self = shift ; - return defined *$self->{FH} - ? *$self->{FH}->fileno() + return defined *$self->{FH} + ? *$self->{FH}->fileno() : undef ; } @@ -966,8 +966,8 @@ sub opened sub autoflush { my $self = shift ; - return defined *$self->{FH} - ? *$self->{FH}->autoflush(@_) + return defined *$self->{FH} + ? *$self->{FH}->autoflush(@_) : undef ; } @@ -995,7 +995,7 @@ sub _notAvailable *PRINTF = \&printf; *WRITE = \&syswrite; *write = \&syswrite; -*SEEK = \&seek; +*SEEK = \&seek; *TELL = \&tell; *EOF = \&eof; *CLOSE = \&close; @@ -1004,13 +1004,13 @@ sub _notAvailable #*sysread = \&_notAvailable; #*syswrite = \&_write; -1; +1; __END__ =head1 NAME -IO::Compress::Base - Base Class for IO::Compress modules +IO::Compress::Base - Base Class for IO::Compress modules =head1 SYNOPSIS @@ -1033,7 +1033,7 @@ L =head1 AUTHOR -This module was written by Paul Marquess, C. +This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY @@ -1041,7 +1041,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/IO-Compress/lib/IO/Compress/Base/Common.pm b/cpan/IO-Compress/lib/IO/Compress/Base/Common.pm index c82c99a441..bd260d5354 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Base/Common.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Base/Common.pm @@ -11,15 +11,15 @@ use File::GlobMapper; require Exporter; our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $HAS_ENCODE); @ISA = qw(Exporter); -$VERSION = '2.074'; +$VERSION = '2.081'; @EXPORT = qw( isaFilehandle isaFilename isaScalar - whatIsInput whatIsOutput + whatIsInput whatIsOutput isaFileGlobString cleanFileGlobString oneTarget setBinModeInput setBinModeOutput - ckInOutParams + ckInOutParams createSelfTiedObject - + isGeMax32 MAX32 @@ -33,7 +33,7 @@ $VERSION = '2.074'; STATUS_ENDSTREAM STATUS_EOF STATUS_ERROR - ); + ); %EXPORT_TAGS = ( Status => [qw( STATUS_OK STATUS_ENDSTREAM @@ -41,15 +41,15 @@ $VERSION = '2.074'; STATUS_ERROR )]); - + use constant STATUS_OK => 0; use constant STATUS_ENDSTREAM => 1; use constant STATUS_EOF => 2; use constant STATUS_ERROR => -1; -use constant MAX16 => 0xFFFF ; -use constant MAX32 => 0xFFFFFFFF ; -use constant MAX32cmp => 0xFFFFFFFF + 1 - 1; # for 5.6.x on 32-bit need to force an non-IV value - +use constant MAX16 => 0xFFFF ; +use constant MAX32 => 0xFFFFFFFF ; +use constant MAX32cmp => 0xFFFFFFFF + 1 - 1; # for 5.6.x on 32-bit need to force an non-IV value + sub isGeMax32 { @@ -89,7 +89,7 @@ sub getEncoding($$$) } our ($needBinmode); -$needBinmode = ($^O eq 'MSWin32' || +$needBinmode = ($^O eq 'MSWin32' || ($] >= 5.006 && eval ' ${^UNICODE} || ${^UTF8LOCALE} ')) ? 1 : 1 ; @@ -97,7 +97,7 @@ sub setBinModeInput($) { my $handle = shift ; - binmode $handle + binmode $handle if $needBinmode; } @@ -112,10 +112,10 @@ sub setBinModeOutput($) sub isaFilehandle($) { use utf8; # Pragma needed to keep Perl 5.6.0 happy - return (defined $_[0] and - (UNIVERSAL::isa($_[0],'GLOB') or + return (defined $_[0] and + (UNIVERSAL::isa($_[0],'GLOB') or UNIVERSAL::isa($_[0],'IO::Handle') or - UNIVERSAL::isa(\$_[0],'GLOB')) + UNIVERSAL::isa(\$_[0],'GLOB')) ) } @@ -126,8 +126,8 @@ sub isaScalar sub isaFilename($) { - return (defined $_[0] and - ! ref $_[0] and + return (defined $_[0] and + ! ref $_[0] and UNIVERSAL::isa(\$_[0], 'SCALAR')); } @@ -154,7 +154,7 @@ use constant WANT_HASH => 0 ; sub whatIsInput($;$) { my $got = whatIs(@_); - + if (defined $got && $got eq 'filename' && defined $_[0] && $_[0] eq '-') { #use IO::File; @@ -169,14 +169,14 @@ sub whatIsInput($;$) sub whatIsOutput($;$) { my $got = whatIs(@_); - + if (defined $got && $got eq 'filename' && defined $_[0] && $_[0] eq '-') { $got = 'handle'; $_[0] = *STDOUT; #$_[0] = new IO::File(">-"); } - + return $got; } @@ -218,9 +218,9 @@ sub IO::Compress::Base::Validator::new my $error_ref = shift ; my $reportClass = shift ; - my %data = (Class => $Class, + my %data = (Class => $Class, Error => $error_ref, - reportClass => $reportClass, + reportClass => $reportClass, ) ; my $obj = bless \%data, $class ; @@ -237,7 +237,7 @@ sub IO::Compress::Base::Validator::new { $obj->croakError("$reportClass: illegal input parameter") ; #return undef ; - } + } # if ($inType eq 'hash') # { @@ -250,18 +250,18 @@ sub IO::Compress::Base::Validator::new { $obj->croakError("$reportClass: illegal output parameter") ; #return undef ; - } + } if ($inType ne 'fileglob' && $outType eq 'fileglob') { $obj->croakError("Need input fileglob for outout fileglob"); - } + } # if ($inType ne 'fileglob' && $outType eq 'hash' && $inType ne 'filename' ) # { # $obj->croakError("input must ne filename or fileglob when output is a hash"); -# } +# } if ($inType eq 'fileglob' && $outType eq 'fileglob') { @@ -276,7 +276,7 @@ sub IO::Compress::Base::Validator::new return $obj; } - + $obj->croakError("$reportClass: input and output $inType are identical") if $inType eq $outType && $_[0] eq $_[1] && $_[0] ne '-' ; @@ -334,7 +334,7 @@ sub IO::Compress::Base::Validator::new } } } - + return $obj ; } @@ -343,7 +343,7 @@ sub IO::Compress::Base::Validator::saveErrorString my $self = shift ; ${ $self->{Error} } = shift ; return undef; - + } sub IO::Compress::Base::Validator::croakError @@ -392,16 +392,16 @@ sub IO::Compress::Base::Validator::validateInputArray if ( @{ $_[0] } == 0 ) { return $self->saveErrorString("empty array reference") ; - } + } foreach my $element ( @{ $_[0] } ) { my $inType = whatIsInput($element); - + if (! $inType) { $self->croakError("unknown input parameter") ; - } + } elsif($inType eq 'filename') { $self->validateInputFilenames($element) @@ -429,13 +429,13 @@ sub IO::Compress::Base::Validator::validateInputArray # if ($ktype ne 'filename') # { # return $self->saveErrorString("hash key not filename") ; -# } +# } # # my %valid = map { $_ => 1 } qw(filename buffer array undef handle) ; # if (! $valid{$vtype}) # { # return $self->saveErrorString("hash value not ok") ; -# } +# } # } # # return $self ; @@ -467,13 +467,13 @@ sub createSelfTiedObject #$VERSION = '2.000_08'; #@ISA = qw(Exporter); -$EXPORT_TAGS{Parse} = [qw( ParseParameters - Parse_any Parse_unsigned Parse_signed +$EXPORT_TAGS{Parse} = [qw( ParseParameters + Parse_any Parse_unsigned Parse_signed Parse_boolean Parse_string Parse_code Parse_writable_scalar ) - ]; + ]; push @EXPORT, @{ $EXPORT_TAGS{Parse} } ; @@ -501,15 +501,15 @@ use constant IxGot => 1 ; sub ParseParameters { - my $level = shift || 0 ; + my $level = shift || 0 ; my $sub = (caller($level + 1))[3] ; local $Carp::CarpLevel = 1 ; - + return $_[1] if @_ == 2 && defined $_[1] && UNIVERSAL::isa($_[1], "IO::Compress::Base::Parameters"); - - my $p = new IO::Compress::Base::Parameters() ; + + my $p = new IO::Compress::Base::Parameters() ; $p->parse(@_) or croak "$sub: $p->[IxError]" ; @@ -527,7 +527,7 @@ sub Init { my $default = shift ; my %got ; - + my $obj = IO::Compress::Base::Parameters::new(); while (my ($key, $v) = each %$default) { @@ -538,7 +538,7 @@ sub Init # my ($first_only, $sticky, $type, $value) = @$v ; my $sticky = 0; my $x ; - $obj->_checkType($key, \$value, $type, 0, \$x) + $obj->_checkType($key, \$value, $type, 0, \$x) or return undef ; $key = lc $key; @@ -548,12 +548,12 @@ sub Init # if $type & Parse_multiple; # $got{$key} = [0, $type, $value, $x, $first_only, $sticky] ; - $got{$key} = [0, $type, $value, $x] ; + $got{$key} = [0, $type, $value, $x] ; # } # # $got{$key}[OFF_PARSED] = 0 ; } - + return bless \%got, "IO::Compress::Base::Parameters::Defaults" ; } @@ -563,7 +563,7 @@ sub IO::Compress::Base::Parameters::new my $obj; $obj->[IxError] = ''; - $obj->[IxGot] = {} ; + $obj->[IxGot] = {} ; return bless $obj, 'IO::Compress::Base::Parameters' ; } @@ -578,13 +578,13 @@ sub IO::Compress::Base::Parameters::setError $self->[IxError] = $error ; return $retval; } - + sub IO::Compress::Base::Parameters::getError { my $self = shift ; return $self->[IxError] ; } - + sub IO::Compress::Base::Parameters::parse { my $self = shift ; @@ -603,21 +603,21 @@ sub IO::Compress::Base::Parameters::parse } elsif (@_ == 1) { my $href = $_[0] ; - + return $self->setError("Expected even number of parameters, got 1") if ! defined $href or ! ref $href or ref $href ne "HASH" ; - + foreach my $key (keys %$href) { push @entered, $key ; push @entered, \$href->{$key} ; } } else { - + my $count = @_; return $self->setError("Expected even number of parameters, got $count") if $count % 2 != 0 ; - + for my $i (0.. $count / 2 - 1) { push @entered, $_[2 * $i] ; push @entered, \$_[2 * $i + 1] ; @@ -626,22 +626,22 @@ sub IO::Compress::Base::Parameters::parse foreach my $key (keys %$default) { - + my ($type, $value) = @{ $default->{$key} } ; - - if ($firstTime) { - $got->{$key} = [0, $type, $value, $value] ; + + if ($firstTime) { + $got->{$key} = [0, $type, $value, $value] ; } else { - $got->{$key}[OFF_PARSED] = 0 ; - } + $got->{$key}[OFF_PARSED] = 0 ; + } } my %parsed = (); - - + + for my $i (0.. @entered / 2 - 1) { my $key = $entered[2* $i] ; my $value = $entered[2* $i+1] ; @@ -651,15 +651,15 @@ sub IO::Compress::Base::Parameters::parse $key =~ s/^-// ; my $canonkey = lc $key; - - if ($got->{$canonkey}) + + if ($got->{$canonkey}) { my $type = $got->{$canonkey}[OFF_TYPE] ; my $parsed = $parsed{$canonkey}; ++ $parsed{$canonkey}; - return $self->setError("Muliple instances of '$key' found") - if $parsed ; + return $self->setError("Muliple instances of '$key' found") + if $parsed ; my $s ; $self->_checkType($key, $value, $type, 1, \$s) @@ -672,7 +672,7 @@ sub IO::Compress::Base::Parameters::parse else { push (@Bad, $key) } } - + if (@Bad) { my ($bad) = join(", ", @Bad) ; return $self->setError("unknown key value(s) $bad") ; @@ -699,14 +699,14 @@ sub IO::Compress::Base::Parameters::_checkType return $self->setError("Parameter '$key' not writable") if readonly $$value ; - if (ref $$value) + if (ref $$value) { return $self->setError("Parameter '$key' not a scalar reference") if ref $$value ne 'SCALAR' ; $$output = $$value ; } - else + else { return $self->setError("Parameter '$key' not a scalar") if ref $value ne 'SCALAR' ; @@ -727,13 +727,13 @@ sub IO::Compress::Base::Parameters::_checkType } elsif ($type & Parse_unsigned) { - + return $self->setError("Parameter '$key' must be an unsigned int, got 'undef'") if ! defined $value ; return $self->setError("Parameter '$key' must be an unsigned int, got '$value'") if $value !~ /^\d+$/; - - $$output = defined $value ? $value : 0 ; + + $$output = defined $value ? $value : 0 ; return 1; } elsif ($type & Parse_signed) @@ -743,7 +743,7 @@ sub IO::Compress::Base::Parameters::_checkType return $self->setError("Parameter '$key' must be a signed int, got '$value'") if $value !~ /^-?\d+$/; - $$output = defined $value ? $value : 0 ; + $$output = defined $value ? $value : 0 ; return 1 ; } elsif ($type & Parse_boolean) @@ -751,13 +751,13 @@ sub IO::Compress::Base::Parameters::_checkType return $self->setError("Parameter '$key' must be an int, got '$value'") if defined $value && $value !~ /^\d*$/; - $$output = defined $value && $value != 0 ? 1 : 0 ; + $$output = defined $value && $value != 0 ? 1 : 0 ; return 1; } elsif ($type & Parse_string) { - $$output = defined $value ? $value : "" ; + $$output = defined $value ? $value : "" ; return 1; } elsif ($type & Parse_code) @@ -765,10 +765,10 @@ sub IO::Compress::Base::Parameters::_checkType return $self->setError("Parameter '$key' must be a code reference, got '$value'") if (! defined $value || ref $value ne 'CODE') ; - $$output = defined $value ? $value : "" ; + $$output = defined $value ? $value : "" ; return 1; } - + $$output = $value ; return 1; } @@ -787,7 +787,7 @@ sub IO::Compress::Base::Parameters::setValue { $_[0]->[IxGot]{$_[1]}[OFF_PARSED] = 1; $_[0]->[IxGot]{$_[1]}[OFF_DEFAULT] = $_[2] ; - $_[0]->[IxGot]{$_[1]}[OFF_FIXED] = $_[2] ; + $_[0]->[IxGot]{$_[1]}[OFF_FIXED] = $_[2] ; } sub IO::Compress::Base::Parameters::valueRef @@ -802,7 +802,7 @@ sub IO::Compress::Base::Parameters::valueOrDefault my $default = shift ; my $value = $self->[IxGot]{$name}[OFF_DEFAULT] ; - + return $value if defined $value ; return $default ; } @@ -841,12 +841,12 @@ sub new { return bless [ 0, 0 ], $_[0] if @_ == 1 ; - + return bless [ $_[1], 0 ], $_[0] if @_ == 2 ; - - return bless [ $_[2], $_[1] ], $_[0] - if @_ == 3 ; + + return bless [ $_[2], $_[1] ], $_[0] + if @_ == 3 ; } sub newUnpack_V64 @@ -870,7 +870,7 @@ sub reset sub clone { - bless [ @{$_[0]} ], ref $_[0] ; + bless [ @{$_[0]} ], ref $_[0] ; } sub getHigh @@ -904,13 +904,13 @@ sub add $_[0]->[HIGH] += $value->[HIGH] ; $value = $value->[LOW]; } - elsif ($value > MAX32) { + elsif ($value > MAX32) { $_[0]->[HIGH] += int($value / HI_1) ; $value = $value % HI_1; } - + my $available = MAX32 - $_[0]->[LOW] ; - + if ($value > $available) { ++ $_[0]->[HIGH] ; $_[0]->[LOW] = $value - $available - 1; @@ -925,13 +925,13 @@ sub add32 # my $self = shift; my $value = $_[1]; - if ($value > MAX32) { + if ($value > MAX32) { $_[0]->[HIGH] += int($value / HI_1) ; $value = $value % HI_1; } - + my $available = MAX32 - $_[0]->[LOW] ; - + if ($value > $available) { ++ $_[0]->[HIGH] ; $_[0]->[LOW] = $value - $available - 1; @@ -997,7 +997,7 @@ sub cmp return $self->[LOW] - $other->[LOW] ; } } - + sub is64bit { @@ -1025,7 +1025,7 @@ sub pack_V64 } -sub full32 +sub full32 { return $_[0] == MAX32 ; } diff --git a/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm b/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm index 5fa5f584d2..94a03f639e 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Bzip2.pm @@ -5,16 +5,16 @@ use warnings; use bytes; require Exporter ; -use IO::Compress::Base 2.074 ; +use IO::Compress::Base 2.081 ; -use IO::Compress::Base::Common 2.074 qw(); -use IO::Compress::Adapter::Bzip2 2.074 ; +use IO::Compress::Base::Common 2.081 qw(); +use IO::Compress::Adapter::Bzip2 2.081 ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error); -$VERSION = '2.074'; +$VERSION = '2.081'; $Bzip2Error = ''; @ISA = qw(IO::Compress::Base Exporter); @@ -51,7 +51,7 @@ sub getExtraParams { my $self = shift ; - use IO::Compress::Base::Common 2.074 qw(:Parse); + use IO::Compress::Base::Common 2.081 qw(:Parse); return ( 'blocksize100k' => [IO::Compress::Base::Common::Parse_unsigned, 1], @@ -143,14 +143,12 @@ __END__ =head1 NAME IO::Compress::Bzip2 - Write bzip2 files/buffers - - =head1 SYNOPSIS use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; - my $status = bzip2 $input => $output [,OPTS] + my $status = bzip2 $input => $output [,OPTS] or die "bzip2 failed: $Bzip2Error\n"; my $z = new IO::Compress::Bzip2 $output [,OPTS] @@ -170,7 +168,7 @@ IO::Compress::Bzip2 - Write bzip2 files/buffers $z->autoflush(); $z->input_line_number(); $z->newStream( [OPTS] ); - + $z->close() ; $Bzip2Error ; @@ -185,14 +183,14 @@ IO::Compress::Bzip2 - Write bzip2 files/buffers binmode $z fileno $z close $z ; - + =head1 DESCRIPTION -This module provides a Perl interface that allows writing bzip2 +This module provides a Perl interface that allows writing bzip2 compressed data to files or buffer. -For reading bzip2 files/buffers, see the companion module +For reading bzip2 files/buffers, see the companion module L. =head1 Functional Interface @@ -204,7 +202,7 @@ section. use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; - bzip2 $input_filename_or_reference => $output_filename_or_reference [,OPTS] + bzip2 $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "bzip2 failed: $Bzip2Error\n"; The functional interface needs Perl5.005 or better. @@ -217,7 +215,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the uncompressed data. +source of the uncompressed data. It can take one of the following forms: @@ -235,17 +233,17 @@ If the C<$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. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$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 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 compressed. @@ -253,8 +251,8 @@ contains valid filenames before any data is compressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C will assume that it is an -I. The input is the list of files that match the +characters "<" and ">" C will assume that it is an +I. The input is the list of files that match the fileglob. See L for more details. @@ -275,7 +273,7 @@ these forms. =item A filename If the C<$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 +assumed to be a filename. This file will be opened for writing and the compressed data will be written to it. =item A filehandle @@ -284,14 +282,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the compressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the compressed data will be pushed onto the array. =item An Output FileGlob @@ -329,7 +327,7 @@ L section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C that are filehandles. If C is specified, and the value is true, it will result in all @@ -371,7 +369,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C is specified, and set to true, it will I all compressed +When C is specified, and set to true, it will I all compressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -415,7 +413,7 @@ compressed data to a buffer, C<$buffer>. my $input = new IO::File " \$buffer + bzip2 $input => \$buffer or die "bzip2 failed: $Bzip2Error\n"; To compress all files in the directory "/my/home" that match "*.txt" @@ -437,7 +435,7 @@ and if you want to compress each file one at a time, this will do the trick for my $input ( glob "/my/home/*.txt" ) { my $output = "$input.bz2" ; - bzip2 $input => $output + bzip2 $input => $output or die "Error compressing '$input': $Bzip2Error\n"; } @@ -450,14 +448,14 @@ The format of the constructor for C is shown below my $z = new IO::Compress::Bzip2 $output [,OPTS] or die "IO::Compress::Bzip2 failed: $Bzip2Error\n"; -It returns an C object on success and undef on failure. +It returns an C object on success and undef on failure. The variable C<$Bzip2Error> will contain an error message on failure. -If you are running Perl 5.005 or better the object, C<$z>, returned from -IO::Compress::Bzip2 can be used exactly like an L filehandle. -This means that all normal output file operations can be carried out -with C<$z>. -For example, to write to a compressed file/buffer you can use either of +If you are running Perl 5.005 or better the object, C<$z>, returned from +IO::Compress::Bzip2 can be used exactly like an L filehandle. +This means that all normal output file operations can be carried out +with C<$z>. +For example, to write to a compressed file/buffer you can use either of these forms $z->print("hello world\n"); @@ -480,7 +478,7 @@ If the C<$output> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output> is a scalar reference, the compressed data will be stored in C<$$output>. @@ -507,7 +505,7 @@ This parameter defaults to 0. =item C<< Append => 0|1 >> -Opens C<$output> in append mode. +Opens C<$output> in append mode. The behaviour of this option is dependent on the type of C<$output>. @@ -537,7 +535,7 @@ This parameter defaults to 0. =item C<< BlockSize100K => number >> -Specify the number of 100K blocks bzip2 uses during compression. +Specify the number of 100K blocks bzip2 uses during compression. Valid values are from 1 to 9, where 9 is best compression. @@ -562,7 +560,7 @@ This is a placeholder option. TODO -=head1 Methods +=head1 Methods =head2 print @@ -672,7 +670,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -695,7 +693,7 @@ retrieve the autoflush setting. $z->input_line_number() $z->input_line_number(EXPR) -This method always returns C when compressing. +This method always returns C when compressing. =head2 fileno @@ -714,7 +712,7 @@ C. $z->close() ; close $z ; -Flushes any pending compressed data and then closes the output file/buffer. +Flushes any pending compressed data and then closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Compress::Bzip2 object is destroyed (either explicitly or by the @@ -747,9 +745,9 @@ the C<$z> object. See the L section for more details. -=head1 Importing +=head1 Importing -No symbolic constants are required by this IO::Compress::Bzip2 at present. +No symbolic constants are required by this IO::Compress::Bzip2 at present. =over 5 @@ -760,8 +758,6 @@ Same as doing this use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; - - =back =head1 EXAMPLES @@ -790,7 +786,7 @@ See the module L =head1 AUTHOR -This module was written by Paul Marquess, C. +This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY @@ -798,7 +794,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/IO-Compress/lib/IO/Compress/Deflate.pm b/cpan/IO-Compress/lib/IO/Compress/Deflate.pm index 379ad9cd73..5e5c37c96a 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Deflate.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Deflate.pm @@ -8,16 +8,16 @@ use bytes; require Exporter ; -use IO::Compress::RawDeflate 2.074 (); -use IO::Compress::Adapter::Deflate 2.074 ; +use IO::Compress::RawDeflate 2.081 (); +use IO::Compress::Adapter::Deflate 2.081 ; -use IO::Compress::Zlib::Constants 2.074 ; -use IO::Compress::Base::Common 2.074 qw(); +use IO::Compress::Zlib::Constants 2.081 ; +use IO::Compress::Base::Common 2.081 qw(); our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $DeflateError); -$VERSION = '2.074'; +$VERSION = '2.081'; $DeflateError = ''; @ISA = qw(IO::Compress::RawDeflate Exporter); @@ -170,14 +170,12 @@ __END__ =head1 NAME IO::Compress::Deflate - Write RFC 1950 files/buffers - - =head1 SYNOPSIS use IO::Compress::Deflate qw(deflate $DeflateError) ; - my $status = deflate $input => $output [,OPTS] + my $status = deflate $input => $output [,OPTS] or die "deflate failed: $DeflateError\n"; my $z = new IO::Compress::Deflate $output [,OPTS] @@ -197,9 +195,9 @@ IO::Compress::Deflate - Write RFC 1950 files/buffers $z->autoflush(); $z->input_line_number(); $z->newStream( [OPTS] ); - + $z->deflateParams(); - + $z->close() ; $DeflateError ; @@ -214,14 +212,14 @@ IO::Compress::Deflate - Write RFC 1950 files/buffers binmode $z fileno $z close $z ; - + =head1 DESCRIPTION This module provides a Perl interface that allows writing compressed data to files or buffer as defined in RFC 1950. -For reading RFC 1950 files/buffers, see the companion module +For reading RFC 1950 files/buffers, see the companion module L. =head1 Functional Interface @@ -233,7 +231,7 @@ section. use IO::Compress::Deflate qw(deflate $DeflateError) ; - deflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] + deflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "deflate failed: $DeflateError\n"; The functional interface needs Perl5.005 or better. @@ -246,7 +244,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the uncompressed data. +source of the uncompressed data. It can take one of the following forms: @@ -264,17 +262,17 @@ If the C<$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. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$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 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 compressed. @@ -282,8 +280,8 @@ contains valid filenames before any data is compressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C will assume that it is an -I. The input is the list of files that match the +characters "<" and ">" C will assume that it is an +I. The input is the list of files that match the fileglob. See L for more details. @@ -304,7 +302,7 @@ these forms. =item A filename If the C<$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 +assumed to be a filename. This file will be opened for writing and the compressed data will be written to it. =item A filehandle @@ -313,14 +311,14 @@ If the C<$output_filename_or_reference> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the compressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference -If C<$output_filename_or_reference> is an array reference, +If C<$output_filename_or_reference> is an array reference, the compressed data will be pushed onto the array. =item An Output FileGlob @@ -358,7 +356,7 @@ L section below. =item C<< AutoClose => 0|1 >> -This option applies to any input or output data streams to +This option applies to any input or output data streams to C that are filehandles. If C is specified, and the value is true, it will result in all @@ -400,7 +398,7 @@ written to it. Otherwise the file pointer will not be moved. =back -When C is specified, and set to true, it will I all compressed +When C is specified, and set to true, it will I all compressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof @@ -444,7 +442,7 @@ compressed data to a buffer, C<$buffer>. my $input = new IO::File " \$buffer + deflate $input => \$buffer or die "deflate failed: $DeflateError\n"; To compress all files in the directory "/my/home" that match "*.txt" @@ -466,7 +464,7 @@ and if you want to compress each file one at a time, this will do the trick for my $input ( glob "/my/home/*.txt" ) { my $output = "$input.1950" ; - deflate $input => $output + deflate $input => $output or die "Error compressing '$input': $DeflateError\n"; } @@ -479,14 +477,14 @@ The format of the constructor for C is shown below my $z = new IO::Compress::Deflate $output [,OPTS] or die "IO::Compress::Deflate failed: $DeflateError\n"; -It returns an C object on success and undef on failure. +It returns an C object on success and undef on failure. The variable C<$DeflateError> will contain an error message on failure. -If you are running Perl 5.005 or better the object, C<$z>, returned from -IO::Compress::Deflate can be used exactly like an L filehandle. -This means that all normal output file operations can be carried out -with C<$z>. -For example, to write to a compressed file/buffer you can use either of +If you are running Perl 5.005 or better the object, C<$z>, returned from +IO::Compress::Deflate can be used exactly like an L filehandle. +This means that all normal output file operations can be carried out +with C<$z>. +For example, to write to a compressed file/buffer you can use either of these forms $z->print("hello world\n"); @@ -509,7 +507,7 @@ If the C<$output> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. -=item A scalar reference +=item A scalar reference If C<$output> is a scalar reference, the compressed data will be stored in C<$$output>. @@ -536,7 +534,7 @@ This parameter defaults to 0. =item C<< Append => 0|1 >> -Opens C<$output> in append mode. +Opens C<$output> in append mode. The behaviour of this option is dependent on the type of C<$output>. @@ -568,20 +566,20 @@ This parameter defaults to 0. This option is used to compress input data and append it to an existing compressed data stream in C<$output>. The end result is a single compressed -data stream stored in C<$output>. +data stream stored in C<$output>. It is a fatal error to attempt to use this option when C<$output> is not an RFC 1950 data stream. There are a number of other limitations with the C option: -=over 5 +=over 5 =item 1 This module needs to have been built with zlib 1.2.1 or better to work. A fatal error will be thrown if C is used with an older version of -zlib. +zlib. =item 2 @@ -591,7 +589,7 @@ If C<$output> is a file or a filehandle, it must be seekable. This parameter defaults to 0. -=item -Level +=item -Level Defines the compression level used by zlib. The value should either be a number between 0 and 9 (0 means no compression and 9 is maximum @@ -610,7 +608,7 @@ Note, these constants are not imported by C by default. use IO::Compress::Deflate qw(:constants); use IO::Compress::Deflate qw(:all); -=item -Strategy +=item -Strategy Defines the strategy used to tune the compression. Use one of the symbolic constants defined below. @@ -633,7 +631,7 @@ This is a placeholder option. TODO -=head1 Methods +=head1 Methods =head2 print @@ -751,7 +749,7 @@ This is a noop provided for completeness. $z->opened() -Returns true if the object currently refers to a opened file/buffer. +Returns true if the object currently refers to a opened file/buffer. =head2 autoflush @@ -774,7 +772,7 @@ retrieve the autoflush setting. $z->input_line_number() $z->input_line_number(EXPR) -This method always returns C when compressing. +This method always returns C when compressing. =head2 fileno @@ -793,7 +791,7 @@ C. $z->close() ; close $z ; -Flushes any pending compressed data and then closes the output file/buffer. +Flushes any pending compressed data and then closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Compress::Deflate object is destroyed (either explicitly or by the @@ -834,9 +832,9 @@ Usage is TODO -=head1 Importing +=head1 Importing -A number of symbolic constants are required by some methods in +A number of symbolic constants are required by some methods in C. None are imported by default. =over 5 @@ -884,9 +882,6 @@ These symbolic constants are used by the C option in the constructor. Z_FIXED Z_DEFAULT_STRATEGY - - - =back =head1 EXAMPLES @@ -909,7 +904,7 @@ L, L, L, L -For RFC 1950, 1951 and 1952 see +For RFC 1950, 1951 and 1952 see L, L and L @@ -924,7 +919,7 @@ The primary site for gzip is L. =head1 AUTHOR -This module was written by Paul Marquess, C. +This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY @@ -932,7 +927,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/IO-Compress/lib/IO/Compress/FAQ.pod b/cpan/IO-Compress/lib/IO/Compress/FAQ.pod index 7099418443..cfd6ca38e0 100644 --- a/cpan/IO-Compress/lib/IO/Compress/FAQ.pod +++ b/cpan/IO-Compress/lib/IO/Compress/FAQ.pod @@ -7,7 +7,7 @@ IO::Compress::FAQ -- Frequently Asked Questions about IO::Compress Common questions answered. -=head1 GENERAL +=head1 GENERAL =head2 Compatibility with Unix compress/uncompress. @@ -104,7 +104,7 @@ recompression. my $gunzip = new IO::Uncompress::Gunzip $gzipFile or die "Cannot gunzip $gzipFile: $GunzipError\n" ; - bzip2 $gunzip => $bzipFile + bzip2 $gunzip => $bzipFile or die "Cannot bzip2 to $bzipFile: $Bzip2Error\n" ; Note, there is a limitation of this technique. Some compression file @@ -146,16 +146,16 @@ Only supported if the C module is installed. Yes, both the C and C modules support the zip feature called I. That allows them to read/write -files/buffers larger than 4Gig. +files/buffers larger than 4Gig. If you are creating a Zip file using the one-shot interface, and any of the input files is greater than 4Gig, a zip64 complaint zip file will be -created. +created. zip "really-large-file" => "my.zip"; Similarly with the one-shot interface, if the input is a buffer larger than -4 Gig, a zip64 complaint zip file will be created. +4 Gig, a zip64 complaint zip file will be created. zip \$really_large_buffer => "my.zip"; @@ -174,11 +174,11 @@ detect if the zip file is zip64. If you intend to manipulate the Zip64 zip files created with C using an external zip/unzip, make sure that it supports -Zip64. +Zip64. In particular, if you are using Info-Zip you need to have zip version 3.x or better to update a Zip64 archive and unzip version 6.x to read a zip64 -archive. +archive. =head2 Can I write more that 64K entries is a Zip files? @@ -209,7 +209,7 @@ The example below illustrates this behaviour $ echo abc | gzip -c >x.gz $ echo def | gzip -c >>x.gz - $ gunzip -c x.gz + $ gunzip -c x.gz abc def @@ -287,7 +287,7 @@ By default C will only uncompress the first bzip2 data stream in a pbzip2 file. To uncompress the complete pbzip2 file you must include the C option, like this. - bunzip2 $input => \$output, MultiStream => 1 + bunzip2 $input => \$output, MultiStream => 1 or die "bunzip2 failed: $Bunzip2Error\n"; =head1 HTTP & NETWORK @@ -334,7 +334,7 @@ L $r, crc => crc32(undef), d => $d, - l => 0 + l => 0 },$class; } @@ -474,7 +474,7 @@ read from the FTP Server. gunzip $retr_fh => $outFilename, AutoClose => 1 or die "Cannot uncompress '$compressed_file': $GunzipError\n"; -and this to compress a file as it is written to the FTP Server +and this to compress a file as it is written to the FTP Server use Net::FTP; use IO::Compress::Gzip qw(:all); @@ -492,13 +492,13 @@ file/buffer and you want to read both. As an example consider the structure of a zip file. This is a well-defined file format that mixes both compressed and uncompressed sections of data in -a single file. +a single file. For the purposes of this discussion you can think of a zip file as sequence of compressed data streams, each of which is prefixed by an uncompressed local header. The local header contains information about the compressed data stream, including the name of the compressed file and, in particular, -the length of the compressed data stream. +the length of the compressed data stream. To illustrate how to use C here is a script that walks a zip file and prints out how many lines are in each compressed file (if you @@ -527,7 +527,7 @@ the other C modules. my $buffer; my $x ; - ($x = $fh->read($buffer, ZIP_LOCAL_HDR_LENGTH)) == ZIP_LOCAL_HDR_LENGTH + ($x = $fh->read($buffer, ZIP_LOCAL_HDR_LENGTH)) == ZIP_LOCAL_HDR_LENGTH or die "Truncated file: $!\n"; my $signature = unpack ("V", substr($buffer, 0, 4)); @@ -539,11 +539,11 @@ the other C modules. my $compressedMethod = unpack ("v", substr($buffer, 8, 2)); my $compressedLength = unpack ("V", substr($buffer, 18, 4)); my $uncompressedLength = unpack ("V", substr($buffer, 22, 4)); - my $filename_length = unpack ("v", substr($buffer, 26, 2)); + my $filename_length = unpack ("v", substr($buffer, 26, 2)); my $extra_length = unpack ("v", substr($buffer, 28, 2)); my $filename ; - $fh->read($filename, $filename_length) == $filename_length + $fh->read($filename, $filename_length) == $filename_length or die "Truncated file\n"; $fh->read($buffer, $extra_length) == $extra_length @@ -582,7 +582,7 @@ the other C modules. } The majority of the code above is concerned with reading the zip local -header data. The code that I want to focus on is at the bottom. +header data. The code that I want to focus on is at the bottom. while (1) { @@ -613,9 +613,9 @@ the C<$fh> filehandle (The only exception is for an error case like a truncated file or a corrupt data stream). This means that once RawInflate is finished C<$fh> will be left at the -byte directly after the compressed data stream. +byte directly after the compressed data stream. -Now consider what the code looks like without C +Now consider what the code looks like without C while (1) { @@ -654,7 +654,7 @@ application can cope with large compressed data streams. One final point -- obviously C can only be used whenever you know the length of the compressed data beforehand, like here with a zip -file. +file. =head1 SEE ALSO @@ -668,7 +668,7 @@ L =head1 AUTHOR -This module was written by Paul Marquess, C. +This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY @@ -676,7 +676,7 @@ See the Changes file. =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2017 Paul Marquess. All rights reserved. +Copyright (c) 2005-2018 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/IO-Compress/lib/IO/Compress/Gzip.pm b/cpan/IO-Compress/lib/IO/Compress/Gzip.pm index db01764624..53816871cf 100644 --- a/cpan/IO-Compress/lib/IO/Compress/Gzip.pm +++ b/cpan/IO-Compress/lib/IO/Compress/Gzip.pm @@ -8,12 +8,12 @@ use bytes; require Exporter ; -use IO::Compress::RawDeflate 2.074 () ; -use IO::Compress::Adapter::Deflate 2.074 ; +use IO::Compress::RawDeflate 2.081 () ; +use IO::Compress::Adapter::Deflate 2.081 ; -use IO::Compress::Base::Common 2.074 qw(:Status ); -use IO::Compress::Gzip::Constants 2.074 ; -use IO::Compress::Zlib::Extra 2.074 ; +use IO::Compress::Base::Common 2.081 qw(:Status ); +use IO::Compress::Gzip::Constants 2.081 ; +use IO::Compress::Zlib::Extra 2.081 ; BEGIN { @@ -25,7 +25,7 @@ BEGIN our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $GzipError); -$VERSION = '2.074'; +$VERSION = '2.081'; $GzipError = '' ; @ISA = qw(IO::Compress::RawDeflate Exporter); @@ -277,14 +277,12 @@ __END__ =head1 NAME IO::Compress::Gzip - Write RFC 1952 files/buffers - - =head1 SYNOPSIS use IO::Compress::Gzip qw(gzip $GzipError) ; - my $status = gzip $input => $output [,OPTS] + my $status = gzip $input => $output [,OPTS] or die "gzip failed: $GzipError\n"; my $z = new IO::Compress::Gzip $output [,OPTS] @@ -304,9 +302,9 @@ IO::Compress::Gzip - Write RFC 1952 files/buffers $z->autoflush(); $z->input_line_number(); $z->newStream( [OPTS] ); - + $z->deflateParams(); - + $z->close() ; $GzipError ; @@ -321,7 +319,7 @@ IO::Compress::Gzip - Write RFC 1952 files/buffers binmode $z fileno $z close $z ; - + =head1 DESCRIPTION @@ -331,7 +329,7 @@ data to files or buffer as defined in RFC 1952. All the gzip headers defined in RFC 1952 can be created using this module. -For reading RFC 1952 files/buffers, see the companion module +For reading RFC 1952 files/buffers, see the companion module L. =head1 Functional Interface @@ -343,7 +341,7 @@ section. use IO::Compress::Gzip qw(gzip $GzipError) ; - gzip $input_filename_or_reference => $output_filename_or_reference [,OPTS] + gzip $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "gzip failed: $GzipError\n"; The functional interface needs Perl5.005 or better. @@ -356,7 +354,7 @@ C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the -source of the uncompressed data. +source of the uncompressed data. It can take one of the following forms: @@ -374,17 +372,17 @@ If the C<$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. -=item A scalar reference +=item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. -=item An array reference +=item An array reference If C<$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 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 compressed. @@ -392,8 +390,8 @@ contains valid filenames before any data is compressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the -characters "<" and ">" C will assume that it is an -I. The input is the list of files that match the +characters "<" and ">" C will assume that it is an +I. The input is the list of files that match the fileglob. See L for more details. @@ -403,7 +401,7 @@ See L for more details. If the C<$input_filename_or_reference> parameter is any other type, C will be returned. -In addition, if C<$input_filename_or_reference> is a simple filename, +In addition, if C<$input_filename_or_reference> is a simple filename, the default values for the C and C