Commit | Line | Data |
---|---|---|
0e9b1cbd PM |
1 | package DBM_Filter::int32 ; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | our $VERSION = '0.01'; | |
7 | ||
8 | # todo get Filter to figure endian. | |
9 | ||
10 | sub Store | |
11 | { | |
12 | $_ = 0 if ! defined $_ || $_ eq "" ; | |
13 | $_ = pack("i", $_); | |
14 | } | |
15 | ||
16 | sub Fetch | |
17 | { | |
18 | no warnings 'uninitialized'; | |
19 | $_ = unpack("i", $_); | |
20 | } | |
21 | ||
22 | 1; | |
23 | ||
24 | __END__ | |
25 | ||
b370a9eb RGS |
26 | =head1 NAME |
27 | ||
28 | DBM_Filter::int32 - filter for DBM_Filter | |
0e9b1cbd PM |
29 | |
30 | =head1 SYNOPSIS | |
31 | ||
32 | use SDBM_File; # or DB_File, or GDBM_File, or NDBM_File, or ODBM_File | |
33 | use DBM_Filter ; | |
34 | ||
35 | $db = tie %hash, ... | |
36 | $db->Filter_Push('int32'); | |
b370a9eb | 37 | |
0e9b1cbd PM |
38 | =head1 DESCRIPTION |
39 | ||
40 | This DBM filter is used when interoperating with a C/C++ application | |
41 | that uses a C int as either the key and/or value in the DBM file. | |
42 | ||
43 | =head1 SEE ALSO | |
44 | ||
45 | L<DBM_Filter>, L<perldbmfilter> | |
46 | ||
47 | =head1 AUTHOR | |
48 | ||
49 | Paul Marquess pmqs@cpan.org | |
50 |