diff options
Diffstat (limited to 'ext/Compress/IO/Zlib/examples/gzappend')
-rw-r--r-- | ext/Compress/IO/Zlib/examples/gzappend | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/Compress/IO/Zlib/examples/gzappend b/ext/Compress/IO/Zlib/examples/gzappend new file mode 100644 index 0000000000..a4a60a9aad --- /dev/null +++ b/ext/Compress/IO/Zlib/examples/gzappend @@ -0,0 +1,24 @@ +#!/usr/local/bin/perl + +use IO::Compress::Gzip qw( $GzipError ); +use strict ; +use warnings ; + +die "Usage: gzappend gz-file file...\n" + unless @ARGV ; + + +my $output = shift @ARGV ; + +@ARGV = '-' unless @ARGV ; + +my $gz = new IO::Compress::Gzip $output, Merge => 1 + or die "Cannot open $output: $GzipError\n" ; + +$gz->write( [@ARGV] ) + or die "Cannot open $output: $GzipError\n" ; + +$gz->close; + + + |