Commit | Line | Data |
f4c6fd49 |
1 | #!/usr/local/bin/perl |
2 | |
3 | use strict ; |
4 | local ($^W) = 1; #use warnings ; |
5 | |
6 | use Compress::Zlib ; |
7 | |
8 | my $x = inflateInit() |
9 | or die "Cannot create a inflation stream\n" ; |
10 | |
11 | my $input = '' ; |
12 | binmode STDIN; |
13 | binmode STDOUT; |
14 | |
15 | my ($output, $status) ; |
16 | while (read(STDIN, $input, 4096)) |
17 | { |
18 | ($output, $status) = $x->inflate(\$input) ; |
19 | |
20 | print $output |
21 | if $status == Z_OK or $status == Z_STREAM_END ; |
22 | |
23 | last if $status != Z_OK ; |
24 | } |
25 | |
26 | die "inflation failed\n" |
27 | unless $status == Z_STREAM_END ; |
28 | |