source: for-distributions/trunk/bin/windows/perl/lib/DBM_Filter/compress.pm@ 14489

Last change on this file since 14489 was 14489, checked in by oranfry, 17 years ago

upgrading to perl 5.8

File size: 837 bytes
Line 
1package DBM_Filter::compress ;
2
3use strict;
4use warnings;
5use Carp;
6
7our $VERSION = '0.01';
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
26=head1 DBM_Filter::compress
27
28=head1 SYNOPSIS
29
30 use SDBM_File; # or DB_File, or GDBM_File, or NDBM_File, or ODBM_File
31 use DBM_Filter ;
32
33 $db = tie %hash, ...
34 $db->Filter_Push('compress');
35
36=head1 DESCRIPTION
37
38This DBM filter will compress all data before it is written to the database
39and uncompressed it on reading.
40
41A fatal error will be thrown if the Compress::Zlib module is not
42available.
43
44=head1 SEE ALSO
45
46L<DBM_Filter>, L<perldbmfilter>, L<Compress::Zlib>
47
48=head1 AUTHOR
49
50Paul Marquess [email protected]
51
Note: See TracBrowser for help on using the repository browser.