Pre-run and disarm the code automodification run by
[p5sagit/p5-mst-13.2.git] / ext / Compress / Zlib / examples / gzstream
1 #!/usr/local/bin/perl
2
3 use strict ;
4 use warnings ;
5
6 use Compress::Zlib ;
7
8 binmode STDOUT; # gzopen only sets it on the fd
9
10 my $gz = gzopen(\*STDOUT, "wb")
11           or die "Cannot open stdout: $gzerrno\n" ;
12
13 while (<>) {
14     $gz->gzwrite($_) 
15         or die "error writing: $gzerrno\n" ;
16 }
17
18 $gz->gzclose ;