home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / libio-compress-zlib-perl / examples / gzappend < prev    next >
Encoding:
Text File  |  2008-02-18  |  405 b   |  25 lines

  1. #!/usr/local/bin/perl
  2.  
  3. use IO::Compress::Gzip qw( $GzipError );
  4. use strict ;
  5. use warnings ;
  6.  
  7. die "Usage: gzappend gz-file file...\n"
  8.     unless @ARGV ;
  9.  
  10.  
  11. my $output = shift @ARGV ;
  12.  
  13. @ARGV = '-' unless @ARGV ;
  14.  
  15. my $gz = new IO::Compress::Gzip $output, Merge => 1
  16.      or die "Cannot open $output: $GzipError\n" ;
  17.  
  18. $gz->write( [@ARGV] )
  19.      or die "Cannot open $output: $GzipError\n" ;
  20.  
  21. $gz->close;
  22.  
  23.     
  24.  
  25.