Integrate mainline + lib/open.t patch from Chromatic
[p5sagit/p5-mst-13.2.git] / ext / GDBM_File / GDBM_File.pm
index 663a679..63225f0 100644 (file)
@@ -22,10 +22,10 @@ interface.
 
 =head1 AVAILABILITY
 
-Gdbm is available from any GNU archive.  The master site is
-C<prep.ai.mit.edu>, but your are strongly urged to use one of the many
-mirrors.   You can obtain a list of mirror sites by issuing the
-command        C<finger fsf@prep.ai.mit.edu>.
+gdbm is available from any GNU archive.  The master site is
+C<ftp.gnu.org>, but you are strongly urged to use one of the many
+mirrors.  You can obtain a list of mirror sites from
+http://www.gnu.org/order/ftp.html.
 
 =head1 BUGS
 
@@ -40,12 +40,12 @@ L<perl(1)>, L<DB_File(3)>, L<perldbmfilter>.
 package GDBM_File;
 
 use strict;
-use vars qw($VERSION @ISA @EXPORT $AUTOLOAD);
+use warnings;
+our($VERSION, @ISA, @EXPORT, $AUTOLOAD);
 
 require Carp;
 require Tie::Hash;
 require Exporter;
-use AutoLoader;
 use XSLoader ();
 @ISA = qw(Tie::Hash Exporter);
 @EXPORT = qw(
@@ -53,35 +53,25 @@ use XSLoader ();
        GDBM_FAST
        GDBM_INSERT
        GDBM_NEWDB
+       GDBM_NOLOCK
        GDBM_READER
        GDBM_REPLACE
        GDBM_WRCREAT
        GDBM_WRITER
 );
 
-$VERSION = "1.03";
+$VERSION = "1.06";
 
 sub AUTOLOAD {
     my($constname);
     ($constname = $AUTOLOAD) =~ s/.*:://;
-    my $val = constant($constname, @_ ? $_[0] : 0);
-    if ($! != 0) {
-       if ($! =~ /Invalid/ || $!{EINVAL}) {
-           $AutoLoader::AUTOLOAD = $AUTOLOAD;
-           goto &AutoLoader::AUTOLOAD;
-       }
-       else {
-           Carp::croak("Your vendor has not defined GDBM_File macro $constname, used");
-       }
-    }
-    eval "sub $AUTOLOAD { $val }";
-    goto &$AUTOLOAD;
+    my ($error, $val) = constant($constname);
+    Carp::croak $error if $error;
+    no strict 'refs';
+    *{$AUTOLOAD} = sub { $val };
+    goto &{$AUTOLOAD};
 }
 
 XSLoader::load 'GDBM_File', $VERSION;
 
-# Preloaded methods go here.  Autoload methods go after __END__, and are
-# processed by the autosplit program.
-
 1;
-__END__