Move if from ext/ to cpan/
[p5sagit/p5-mst-13.2.git] / cpan / IO-Compress / examples / compress-zlib / 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 my $gz = gzopen('-', "wb")
12           or die "Cannot open stdout: $gzerrno\n" ;
13
14 while (<>) {
15     $gz->gzwrite($_) 
16         or die "error writing: $gzerrno\n" ;
17 }
18
19 $gz->gzclose ;