summaryrefslogtreecommitdiff
path: root/ext/Compress/Zlib/examples/gzstream
blob: 22d3d27b275ba5afc09a6891865ffaf9c1a2318e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/local/bin/perl

use strict ;
local ($^W) = 1; #use warnings ;

use Compress::Zlib ;

binmode STDOUT;	# gzopen only sets it on the fd

my $gz = gzopen(\*STDOUT, "wb")
	  or die "Cannot open stdout: $gzerrno\n" ;

while (<>) {
    $gz->gzwrite($_) 
	or die "error writing: $gzerrno\n" ;
}

$gz->gzclose ;