Commit | Line | Data |
---|---|---|
f4c6fd49 | 1 | #!/usr/local/bin/perl |
2 | ||
3 | use strict ; | |
8aa25532 | 4 | use warnings ; |
f4c6fd49 | 5 | |
25f0751f | 6 | use Compress::Zlib ; |
f4c6fd49 | 7 | |
25f0751f | 8 | binmode STDOUT; # gzopen only sets it on the fd |
f4c6fd49 | 9 | |
cb7abd7f | 10 | #my $gz = gzopen(\*STDOUT, "wb") |
11 | my $gz = gzopen('-', "wb") | |
25f0751f | 12 | or die "Cannot open stdout: $gzerrno\n" ; |
f4c6fd49 | 13 | |
14 | while (<>) { | |
25f0751f | 15 | $gz->gzwrite($_) |
16 | or die "error writing: $gzerrno\n" ; | |
f4c6fd49 | 17 | } |
18 | ||
25f0751f | 19 | $gz->gzclose ; |