This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
allow evals to see the full lexical scope
[perl5.git] / ext / GDBM_File / GDBM_File.pm
CommitLineData
4633a7c4 1# GDBM_File.pm -- Perl 5 interface to GNU gdbm library.
bd81798f 2
4633a7c4
LW
3=head1 NAME
4
5GDBM_File - Perl5 access to the gdbm library.
6
7=head1 SYNOPSIS
8
9 use GDBM_File ;
02c45c47 10 tie %hash, 'GDBM_File', $filename, &GDBM_WRCREAT, 0640;
4633a7c4
LW
11 # Use the %hash array.
12 untie %hash ;
13
14=head1 DESCRIPTION
15
16B<GDBM_File> is a module which allows Perl programs to make use of the
17facilities provided by the GNU gdbm library. If you intend to use this
18module you should really have a copy of the gdbm manualpage at hand.
19
20Most of the libgdbm.a functions are available through the GDBM_File
21interface.
22
23=head1 AVAILABILITY
24
16c2cc08
RA
25gdbm is available from any GNU archive. The master site is
26C<ftp.gnu.org>, but you are strongly urged to use one of the many
27mirrors. You can obtain a list of mirror sites from
28http://www.gnu.org/order/ftp.html.
4633a7c4
LW
29
30=head1 BUGS
31
32The available functions and the gdbm/perl interface need to be documented.
33
34=head1 SEE ALSO
35
9fe6733a 36L<perl(1)>, L<DB_File(3)>, L<perldbmfilter>.
4633a7c4
LW
37
38=cut
39
a0d0e21e
LW
40package GDBM_File;
41
96318ac8 42use strict;
698828ad 43use warnings;
17f410f9 44our($VERSION, @ISA, @EXPORT, $AUTOLOAD);
96318ac8 45
a0d0e21e 46require Carp;
96318ac8 47require Tie::Hash;
a0d0e21e 48require Exporter;
9426adcd
IZ
49use XSLoader ();
50@ISA = qw(Tie::Hash Exporter);
a0d0e21e
LW
51@EXPORT = qw(
52 GDBM_CACHESIZE
53 GDBM_FAST
54 GDBM_INSERT
55 GDBM_NEWDB
8722d079 56 GDBM_NOLOCK
a0d0e21e
LW
57 GDBM_READER
58 GDBM_REPLACE
59 GDBM_WRCREAT
60 GDBM_WRITER
61);
62
97a5fa0b 63$VERSION = "1.06";
c07a80fd 64
a0d0e21e 65sub AUTOLOAD {
96318ac8 66 my($constname);
a0d0e21e 67 ($constname = $AUTOLOAD) =~ s/.*:://;
97a5fa0b
NC
68 my ($error, $val) = constant($constname);
69 Carp::croak $error if $error;
57c77851
JS
70 no strict 'refs';
71 *{$AUTOLOAD} = sub { $val };
72 goto &{$AUTOLOAD};
a0d0e21e
LW
73}
74
9426adcd 75XSLoader::load 'GDBM_File', $VERSION;
a0d0e21e 76
a0d0e21e 771;