This is my patch patch.1h for perl5.001.
[p5sagit/p5-mst-13.2.git] / ext / GDBM_File / GDBM_File.pm
1 package GDBM_File;
2
3 require Carp;
4 require TieHash;
5 require Exporter;
6 use AutoLoader;
7 require DynaLoader;
8 @ISA = qw(TieHash Exporter DynaLoader);
9 @EXPORT = qw(
10         GDBM_CACHESIZE
11         GDBM_FAST
12         GDBM_INSERT
13         GDBM_NEWDB
14         GDBM_READER
15         GDBM_REPLACE
16         GDBM_WRCREAT
17         GDBM_WRITER
18 );
19
20 sub AUTOLOAD {
21     local($constname);
22     ($constname = $AUTOLOAD) =~ s/.*:://;
23     $val = constant($constname, @_ ? $_[0] : 0);
24     if ($! != 0) {
25         if ($! =~ /Invalid/) {
26             $AutoLoader::AUTOLOAD = $AUTOLOAD;
27             goto &AutoLoader::AUTOLOAD;
28         }
29         else {
30             Carp::croak("Your vendor has not defined GDBM_File macro $constname, used");
31         }
32     }
33     eval "sub $AUTOLOAD { $val }";
34     goto &$AUTOLOAD;
35 }
36
37 bootstrap GDBM_File;
38
39 # Preloaded methods go here.  Autoload methods go after __END__, and are
40 # processed by the autosplit program.
41
42 1;
43 __END__