This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix execute permissions on the last commit
[perl5.git] / cpan / Compress-Raw-Zlib / examples / filtdef
CommitLineData
25f0751f
PM
1#!/usr/local/bin/perl
2
3use Compress::Raw::Zlib ;
4
5use strict ;
6use warnings ;
7
8binmode STDIN;
9binmode STDOUT;
10
11my $x = new Compress::Raw::Zlib::Deflate()
12 or die "Cannot create a deflation stream\n" ;
13
14my $output = '' ;
15
16while (<>)
17{
18 $x->deflate($_, $output) == Z_OK
19 or die "deflate failed\n" ;
20
21 print $output ;
22}
23
24$x->flush($output) == Z_OK
25 or die "flush failed\n" ;
26
27print $output ;