This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
warnings: fix POD typo "you" → "your"
[perl5.git] / lib / DBM_Filter / compress.pm
CommitLineData
0e9b1cbd
PM
1package DBM_Filter::compress ;
2
3use strict;
4use warnings;
5use Carp;
6
493efffc 7our $VERSION = '0.03';
0e9b1cbd
PM
8
9BEGIN
10{
11 eval { require Compress::Zlib; Compress::Zlib->import() };
12
13 croak "Compress::Zlib module not found.\n"
14 if $@;
15}
16
17
18
19sub Store { $_ = compress($_) }
20sub Fetch { $_ = uncompress($_) }
21
221;
23
24__END__
25
b370a9eb
RGS
26=head1 NAME
27
28DBM_Filter::compress - filter for DBM_Filter
0e9b1cbd
PM
29
30=head1 SYNOPSIS
31
555bd962 32 use SDBM_File; # or DB_File, GDBM_File, NDBM_File, ODBM_File
0e9b1cbd
PM
33 use DBM_Filter ;
34
35 $db = tie %hash, ...
36 $db->Filter_Push('compress');
b370a9eb 37
0e9b1cbd
PM
38=head1 DESCRIPTION
39
40This DBM filter will compress all data before it is written to the database
41and uncompressed it on reading.
42
43A fatal error will be thrown if the Compress::Zlib module is not
44available.
45
46=head1 SEE ALSO
47
48L<DBM_Filter>, L<perldbmfilter>, L<Compress::Zlib>
49
50=head1 AUTHOR
51
52Paul Marquess pmqs@cpan.org
53