summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/IO-Compress/lib/IO/Compress/Gzip.pm
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2021-03-01 23:19:42 +0000
committerafresh1 <afresh1@openbsd.org>2021-03-01 23:19:42 +0000
commit56d68f1e19ff848c889ecfa71d3a06340ff64892 (patch)
tree272372e9e82dd675d06054187c7f04b32fe71acc /gnu/usr.bin/perl/cpan/IO-Compress/lib/IO/Compress/Gzip.pm
parentImport perl-5.32.1 (diff)
downloadwireguard-openbsd-56d68f1e19ff848c889ecfa71d3a06340ff64892.tar.xz
wireguard-openbsd-56d68f1e19ff848c889ecfa71d3a06340ff64892.zip
Fix merge issues, remove excess files - match perl-5.32.1 dist
OK sthen@
Diffstat (limited to 'gnu/usr.bin/perl/cpan/IO-Compress/lib/IO/Compress/Gzip.pm')
-rw-r--r--gnu/usr.bin/perl/cpan/IO-Compress/lib/IO/Compress/Gzip.pm52
1 files changed, 39 insertions, 13 deletions
diff --git a/gnu/usr.bin/perl/cpan/IO-Compress/lib/IO/Compress/Gzip.pm b/gnu/usr.bin/perl/cpan/IO-Compress/lib/IO/Compress/Gzip.pm
index 5302011a20d..3fd13695083 100644
--- a/gnu/usr.bin/perl/cpan/IO-Compress/lib/IO/Compress/Gzip.pm
+++ b/gnu/usr.bin/perl/cpan/IO-Compress/lib/IO/Compress/Gzip.pm
@@ -8,12 +8,12 @@ use bytes;
require Exporter ;
-use IO::Compress::RawDeflate 2.084 () ;
-use IO::Compress::Adapter::Deflate 2.084 ;
+use IO::Compress::RawDeflate 2.093 () ;
+use IO::Compress::Adapter::Deflate 2.093 ;
-use IO::Compress::Base::Common 2.084 qw(:Status );
-use IO::Compress::Gzip::Constants 2.084 ;
-use IO::Compress::Zlib::Extra 2.084 ;
+use IO::Compress::Base::Common 2.093 qw(:Status );
+use IO::Compress::Gzip::Constants 2.093 ;
+use IO::Compress::Zlib::Extra 2.093 ;
BEGIN
{
@@ -25,7 +25,7 @@ BEGIN
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $GzipError);
-$VERSION = '2.084';
+$VERSION = '2.093';
$GzipError = '' ;
@ISA = qw(IO::Compress::RawDeflate Exporter);
@@ -319,7 +319,6 @@ IO::Compress::Gzip - Write RFC 1952 files/buffers
binmode $z
fileno $z
close $z ;
-
=head1 DESCRIPTION
@@ -349,7 +348,8 @@ The functional interface needs Perl5.005 or better.
=head2 gzip $input_filename_or_reference => $output_filename_or_reference [, OPTS]
C<gzip> expects at least two parameters,
-C<$input_filename_or_reference> and C<$output_filename_or_reference>.
+C<$input_filename_or_reference> and C<$output_filename_or_reference>
+and zero or more optional parameters (see L</Optional Parameters>)
=head3 The C<$input_filename_or_reference> parameter
@@ -362,7 +362,7 @@ It can take one of the following forms:
=item A filename
-If the <$input_filename_or_reference> parameter is a simple scalar, it is
+If the C<$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.
@@ -466,9 +466,9 @@ in C<$output_filename_or_reference> as a concatenated series of compressed data
=head2 Optional Parameters
-Unless specified below, the optional parameters for C<gzip>,
-C<OPTS>, are the same as those used with the OO interface defined in the
-L</"Constructor Options"> section below.
+The optional parameters for the one-shot function C<gzip>
+are (for the most part) identical to those used with the OO interface defined in the
+L</"Constructor Options"> section. The exceptions are listed below
=over 5
@@ -536,6 +536,22 @@ Defaults to 0.
=head2 Examples
+Here are a few example that show the capabilities of the module.
+
+=head3 Streaming
+
+This very simple command line example demonstrates the streaming capabilities of the module.
+The code reads data from STDIN, compresses it, and writes the compressed data to STDOUT.
+
+ $ echo hello world | perl -MIO::Compress::Gzip=gzip -e 'gzip \*STDIN => \*STDOUT' >output.gz
+
+The special filename "-" can be used as a standin for both C<\*STDIN> and C<\*STDOUT>,
+so the above can be rewritten as
+
+ $ echo hello world | perl -MIO::Compress::Gzip=gzip -e 'gzip "-" => "-"' >output.gz
+
+=head3 Compressing a file from the filesystem
+
To read the contents of the file C<file1.txt> and write the compressed
data to the file C<file1.txt.gz>.
@@ -547,6 +563,8 @@ data to the file C<file1.txt.gz>.
gzip $input => "$input.gz"
or die "gzip failed: $GzipError\n";
+=head3 Reading from a Filehandle and writing to an in-memory buffer
+
To read from an existing Perl filehandle, C<$input>, and write the
compressed data to a buffer, C<$buffer>.
@@ -561,6 +579,8 @@ compressed data to a buffer, C<$buffer>.
gzip $input => \$buffer
or die "gzip failed: $GzipError\n";
+=head3 Compressing multiple files
+
To compress all files in the directory "/my/home" that match "*.txt"
and store the compressed data in the same directory
@@ -635,7 +655,7 @@ return undef.
=head2 Constructor Options
-C<OPTS> is any combination of the following options:
+C<OPTS> is any combination of zero or more the following options:
=over 5
@@ -1204,6 +1224,12 @@ See L<IO::Compress::FAQ|IO::Compress::FAQ/"Apache::GZip Revisited">
See L<IO::Compress::FAQ|IO::Compress::FAQ/"Compressed files and Net::FTP">
+=head1 SUPPORT
+
+General feedback/questions/bug reports should be sent to
+L<https://github.com/pmqs/IO-Copress/issues> (preferred) or
+L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Copress>.
+
=head1 SEE ALSO
L<Compress::Zlib>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzma>, L<IO::Uncompress::UnLzma>, L<IO::Compress::Xz>, L<IO::Uncompress::UnXz>, L<IO::Compress::Lzip>, L<IO::Uncompress::UnLzip>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Compress::Zstd>, L<IO::Uncompress::UnZstd>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>