ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/staticperl/perl/lib/DBM_Filter/null.pm
Revision: 1.1
Committed: Thu Jun 30 14:27:10 2005 UTC (21 years, 4 months ago) by root
Branch: MAIN
CVS Tags: PERL-5-8-7, HEAD
Branch point for: PERL
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 package DBM_Filter::null ;
2    
3     use strict;
4     use warnings;
5    
6     our $VERSION = '0.01';
7    
8     sub Store
9     {
10     no warnings 'uninitialized';
11     $_ .= "\x00" ;
12     }
13    
14     sub Fetch
15     {
16     no warnings 'uninitialized';
17     s/\x00$// ;
18     }
19    
20     1;
21    
22     __END__
23    
24     =head1 DBM_Filter::null
25    
26     =head1 SYNOPSIS
27    
28     use SDBM_File; # or DB_File, or GDBM_File, or NDBM_File, or ODBM_File
29     use DBM_Filter ;
30    
31     $db = tie %hash, ...
32     $db->Filter_Push('null');
33    
34     =head1 DESCRIPTION
35    
36     This filter ensures that all data written to the DBM file is null
37     terminated. This is useful when you have a perl script that needs
38     to interoperate with a DBM file that a C program also uses. A fairly
39     common issue is for the C application to include the terminating null
40     in a string when it writes to the DBM file. This filter will ensure that
41     all data written to the DBM file can be read by the C application.
42    
43    
44     =head1 SEE ALSO
45    
46     L<DBM_Filter>, L<perldbmfilter>
47    
48     =head1 AUTHOR
49    
50     Paul Marquess pmqs@cpan.org