File: filtdef

package info (click to toggle)
libcompress-raw-zlib-perl 2.213-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,148 kB
  • sloc: ansic: 6,992; perl: 2,934; makefile: 11
file content (27 lines) | stat: -rwxr-xr-x 407 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/local/bin/perl

use Compress::Raw::Zlib ;

use strict ;
use warnings ;

binmode STDIN;
binmode STDOUT;

my $x = new Compress::Raw::Zlib::Deflate()
   or die "Cannot create a deflation stream\n" ;

my $output = '' ;

while (<>)
{
    $x->deflate($_, $output) == Z_OK
        or die "deflate failed\n" ;

    print $output ;
}

$x->flush($output) == Z_OK
    or die "flush failed\n" ;

print $output ;