File Coverage

examples/compress-zlib/gzstream
Criterion Covered Total %
statement 14 14 100.0
branch 2 4 50.0
condition n/a
subroutine 3 3 100.0
pod n/a
total 19 21 90.4


line stmt bran cond sub pod time code
1             #!/usr/local/bin/perl
2              
3 1     1   5774 use strict ;
  1         2  
  1         43  
4 1     1   5 use warnings ;
  1         2  
  1         60  
5              
6 1     1   737 use Compress::Zlib ;
  1         3  
  1         1982  
7              
8 1         292894 binmode STDOUT; # gzopen only sets it on the fd
9              
10             #my $gz = gzopen(\*STDOUT, "wb")
11 1 50       9 my $gz = gzopen('-', "wb")
12             or die "Cannot open stdout: $gzerrno\n" ;
13              
14 1         74 while (<>) {
15 7 50       31 $gz->gzwrite($_)
16             or die "error writing: $gzerrno\n" ;
17             }
18              
19 1         20 $gz->gzclose ;