perl 5.002beta2 patch
[p5sagit/p5-mst-13.2.git] / ext / GDBM_File / GDBM_File.pm
CommitLineData
4633a7c4 1# GDBM_File.pm -- Perl 5 interface to GNU gdbm library.
2=head1 NAME
3
4GDBM_File - Perl5 access to the gdbm library.
5
6=head1 SYNOPSIS
7
8 use GDBM_File ;
9 tie %hash, GDBM_File, $filename, &GDBM_WRCREAT, 0640);
10 # Use the %hash array.
11 untie %hash ;
12
13=head1 DESCRIPTION
14
15B<GDBM_File> is a module which allows Perl programs to make use of the
16facilities provided by the GNU gdbm library. If you intend to use this
17module you should really have a copy of the gdbm manualpage at hand.
18
19Most of the libgdbm.a functions are available through the GDBM_File
20interface.
21
22=head1 AVAILABILITY
23
24Gdbm is available from any GNU archive. The master site is
25C<prep.ai.mit.edu>, but your are strongly urged to use one of the many
26mirrors. You can obtain a list of mirror sites by issuing the
27command C<finger fsf@prep.ai.mit.edu>.
28
29=head1 BUGS
30
31The available functions and the gdbm/perl interface need to be documented.
32
33=head1 SEE ALSO
34
35L<perl(1)>, L<DB_File(3)>.
36
37=cut
38
a0d0e21e 39package GDBM_File;
40
41require Carp;
42require TieHash;
43require Exporter;
3b35bae3 44use AutoLoader;
a0d0e21e 45require DynaLoader;
fec02dd3 46@ISA = qw(TieHash Exporter DynaLoader);
a0d0e21e 47@EXPORT = qw(
48 GDBM_CACHESIZE
49 GDBM_FAST
50 GDBM_INSERT
51 GDBM_NEWDB
52 GDBM_READER
53 GDBM_REPLACE
54 GDBM_WRCREAT
55 GDBM_WRITER
56);
57
58sub AUTOLOAD {
a0d0e21e 59 local($constname);
60 ($constname = $AUTOLOAD) =~ s/.*:://;
61 $val = constant($constname, @_ ? $_[0] : 0);
62 if ($! != 0) {
63 if ($! =~ /Invalid/) {
64 $AutoLoader::AUTOLOAD = $AUTOLOAD;
65 goto &AutoLoader::AUTOLOAD;
66 }
67 else {
68 Carp::croak("Your vendor has not defined GDBM_File macro $constname, used");
69 }
70 }
71 eval "sub $AUTOLOAD { $val }";
72 goto &$AUTOLOAD;
73}
74
75bootstrap GDBM_File;
76
77# Preloaded methods go here. Autoload methods go after __END__, and are
78# processed by the autosplit program.
79
801;
81__END__