Upgrade to Compress::Zlib 2.000_05
[p5sagit/p5-mst-13.2.git] / ext / Compress / Zlib / examples / filtdef
CommitLineData
f4c6fd49 1#!/usr/local/bin/perl
2
642e522c 3use Compress::Zlib 2 ;
4
f4c6fd49 5use strict ;
8aa25532 6use warnings ;
f4c6fd49 7
f4c6fd49 8binmode STDIN;
9binmode STDOUT;
642e522c 10
11my $x = new Compress::Zlib::Deflate()
f4c6fd49 12 or die "Cannot create a deflation stream\n" ;
13
642e522c 14my $output = '' ;
15
f4c6fd49 16while (<>)
17{
642e522c 18 $x->deflate($_, $output) == Z_OK
19 or die "deflate failed\n" ;
f4c6fd49 20
21 print $output ;
22}
23
642e522c 24$x->flush($output) == Z_OK
25 or die "flush failed\n" ;
f4c6fd49 26
27print $output ;