Change 27380 (HEK into the IV union failed to convert the code in the
[p5sagit/p5-mst-13.2.git] / ext / Compress / Zlib / examples / filtinf
CommitLineData
f4c6fd49 1#!/usr/local/bin/perl
2
642e522c 3use Compress::Zlib 2 ;
4
f4c6fd49 5use strict ;
8aa25532 6use warnings ;
f4c6fd49 7
642e522c 8binmode STDIN;
9binmode STDOUT;
f4c6fd49 10
642e522c 11my $x = new Compress::Zlib::Inflate
f4c6fd49 12 or die "Cannot create a inflation stream\n" ;
13
14my $input = '' ;
642e522c 15my $output = '' ;
16my $status ;
f4c6fd49 17
f4c6fd49 18while (read(STDIN, $input, 4096))
19{
642e522c 20 $status = $x->inflate($input, $output) ;
f4c6fd49 21
22 print $output
23 if $status == Z_OK or $status == Z_STREAM_END ;
24
25 last if $status != Z_OK ;
26}
27
28die "inflation failed\n"
29 unless $status == Z_STREAM_END ;
30