diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/IO/Compress/Deflate.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/IO/Compress/Deflate.pm | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/Master/tlpkg/tlperl/lib/IO/Compress/Deflate.pm b/Master/tlpkg/tlperl/lib/IO/Compress/Deflate.pm index 1ca86c9331c..5ecac19b889 100644 --- a/Master/tlpkg/tlperl/lib/IO/Compress/Deflate.pm +++ b/Master/tlpkg/tlperl/lib/IO/Compress/Deflate.pm @@ -8,16 +8,16 @@ 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::Zlib::Constants 2.084 ; -use IO::Compress::Base::Common 2.084 qw(); +use IO::Compress::Zlib::Constants 2.093 ; +use IO::Compress::Base::Common 2.093 qw(); our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $DeflateError); -$VERSION = '2.084'; +$VERSION = '2.093'; $DeflateError = ''; @ISA = qw(IO::Compress::RawDeflate Exporter); @@ -212,7 +212,6 @@ IO::Compress::Deflate - Write RFC 1950 files/buffers binmode $z fileno $z close $z ; - =head1 DESCRIPTION @@ -239,7 +238,8 @@ The functional interface needs Perl5.005 or better. =head2 deflate $input_filename_or_reference => $output_filename_or_reference [, OPTS] C<deflate> 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 @@ -252,7 +252,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. @@ -348,9 +348,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<deflate>, -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<deflate> +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 @@ -418,6 +418,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::Deflate=deflate -e 'deflate \*STDIN => \*STDOUT' >output.1950 + +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::Deflate=deflate -e 'deflate "-" => "-"' >output.1950 + +=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.1950>. @@ -429,6 +445,8 @@ data to the file C<file1.txt.1950>. deflate $input => "$input.1950" or die "deflate failed: $DeflateError\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>. @@ -443,6 +461,8 @@ compressed data to a buffer, C<$buffer>. deflate $input => \$buffer or die "deflate failed: $DeflateError\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 @@ -517,7 +537,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 @@ -892,6 +912,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-Compress/issues> (preferred) or +L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>. + =head1 SEE ALSO L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, 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> |