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   4557 use strict ;
  1         2  
  1         41  
4 1     1   5 use warnings ;
  1         2  
  1         51  
5              
6 1     1   718 use Compress::Zlib ;
  1         4  
  1         2056  
7              
8 1         225404 binmode STDOUT; # gzopen only sets it on the fd
9              
10             #my $gz = gzopen(\*STDOUT, "wb")
11 1 50       8 my $gz = gzopen('-', "wb")
12             or die "Cannot open stdout: $gzerrno\n" ;
13              
14 1         78 while (<>) {
15 7 50       56 $gz->gzwrite($_)
16             or die "error writing: $gzerrno\n" ;
17             }
18              
19 1         20 $gz->gzclose ;