Start anew
[git/jnareb-git.git] / lib / perl5 / 5.6.1 / msys / GDBM_File.pm
blob310243c736e8233a984f7d6fa98ec65121f8b04b
1 # GDBM_File.pm -- Perl 5 interface to GNU gdbm library.
3 =head1 NAME
5 GDBM_File - Perl5 access to the gdbm library.
7 =head1 SYNOPSIS
9 use GDBM_File ;
10 tie %hash, 'GDBM_File', $filename, &GDBM_WRCREAT, 0640;
11 # Use the %hash array.
12 untie %hash ;
14 =head1 DESCRIPTION
16 B<GDBM_File> is a module which allows Perl programs to make use of the
17 facilities provided by the GNU gdbm library. If you intend to use this
18 module you should really have a copy of the gdbm manualpage at hand.
20 Most of the libgdbm.a functions are available through the GDBM_File
21 interface.
23 =head1 AVAILABILITY
25 Gdbm is available from any GNU archive. The master site is
26 C<prep.ai.mit.edu>, but your are strongly urged to use one of the many
27 mirrors. You can obtain a list of mirror sites by issuing the
28 command C<finger fsf@prep.ai.mit.edu>.
30 =head1 BUGS
32 The available functions and the gdbm/perl interface need to be documented.
34 =head1 SEE ALSO
36 L<perl(1)>, L<DB_File(3)>, L<perldbmfilter>.
38 =cut
40 package GDBM_File;
42 use strict;
43 use warnings;
44 our($VERSION, @ISA, @EXPORT, $AUTOLOAD);
46 require Carp;
47 require Tie::Hash;
48 require Exporter;
49 use AutoLoader;
50 use XSLoader ();
51 @ISA = qw(Tie::Hash Exporter);
52 @EXPORT = qw(
53 GDBM_CACHESIZE
54 GDBM_FAST
55 GDBM_INSERT
56 GDBM_NEWDB
57 GDBM_NOLOCK
58 GDBM_READER
59 GDBM_REPLACE
60 GDBM_WRCREAT
61 GDBM_WRITER
64 $VERSION = "1.05";
66 sub AUTOLOAD {
67 my($constname);
68 ($constname = $AUTOLOAD) =~ s/.*:://;
69 my $val = constant($constname, @_ ? $_[0] : 0);
70 if ($! != 0) {
71 if ($! =~ /Invalid/ || $!{EINVAL}) {
72 $AutoLoader::AUTOLOAD = $AUTOLOAD;
73 goto &AutoLoader::AUTOLOAD;
75 else {
76 Carp::croak("Your vendor has not defined GDBM_File macro $constname, used");
79 eval "sub $AUTOLOAD { $val }";
80 goto &$AUTOLOAD;
83 XSLoader::load 'GDBM_File', $VERSION;
85 # Preloaded methods go here. Autoload methods go after __END__, and are
86 # processed by the autosplit program.
89 __END__