~ubuntu-branches/ubuntu/intrepid/horae/intrepid

« back to all changes in this revision

Viewing changes to 0CPAN/Compress-Zlib-1.41/examples/filtinf

  • Committer: Bazaar Package Importer
  • Author(s): Carlo Segre
  • Date: 2008-02-23 23:13:02 UTC
  • mfrom: (2.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080223231302-mnyyxs3icvrus4ke
Tags: 066-3
Apply patch to athena_parts/misc.pl for compatibility with 
perl-tk 804.28.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/local/bin/perl
2
 
 
3
 
use strict ;
4
 
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