projects
/
p5sagit/p5-mst-13.2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Move if from ext/ to cpan/
[p5sagit/p5-mst-13.2.git]
/
cpan
/
IO-Compress
/
examples
/
compress-zlib
/
filtdef
1
#!/usr/local/bin/perl
2
3
use strict ;
4
use warnings ;
5
6
use Compress::Zlib ;
7
8
binmode STDIN;
9
binmode STDOUT;
10
my $x = deflateInit()
11
or die "Cannot create a deflation stream\n" ;
12
13
my ($output, $status) ;
14
while (<>)
15
{
16
($output, $status) = $x->deflate($_) ;
17
18
$status == Z_OK
19
or die "deflation failed\n" ;
20
21
print $output ;
22
}
23
24
($output, $status) = $x->flush() ;
25
26
$status == Z_OK
27
or die "deflation failed\n" ;
28
29
print $output ;