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   3654 use strict ;
  1         1  
  1         30  
4 1     1   3 use warnings ;
  1         1  
  1         35  
5              
6 1     1   490 use Compress::Zlib ;
  1         4  
  1         1298  
7              
8 1         123630 binmode STDOUT; # gzopen only sets it on the fd
9              
10             #my $gz = gzopen(\*STDOUT, "wb")
11 1 50       5 my $gz = gzopen('-', "wb")
12             or die "Cannot open stdout: $gzerrno\n" ;
13              
14 1         44 while (<>) {
15 7 50       12 $gz->gzwrite($_)
16             or die "error writing: $gzerrno\n" ;
17             }
18              
19 1         3 $gz->gzclose ;