This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
compression modules update to version 2.005
[perl5.git] / ext / IO_Compress_Zlib / examples / gzstream
CommitLineData
25f0751f
PM
1#!/usr/local/bin/perl
2
3use strict ;
4use warnings ;
5use IO::Compress::Gzip qw(gzip $GzipError);
6
7gzip '-' => '-', Minimal => 1
8 or die "gzstream: $GzipError\n" ;
9
10#exit 0;
11
12__END__
13
14#my $gz = new IO::Compress::Gzip *STDOUT
15my $gz = new IO::Compress::Gzip '-'
16 or die "gzstream: Cannot open stdout as gzip stream: $GzipError\n" ;
17
18while (<>) {
19 $gz->write($_)
20 or die "gzstream: Error writing gzip output stream: $GzipError\n" ;
21}
22
23$gz->close
24 or die "gzstream: Error closing gzip output stream: $GzipError\n" ;