documentation tweaks from M. J. T. Guy, Micheal Schwern, and
[p5sagit/p5-mst-13.2.git] / lib / AutoLoader.pm
index 1ca3b14..4bbcb33 100644 (file)
@@ -1,17 +1,17 @@
 package AutoLoader;
 
-use vars qw(@EXPORT @EXPORT_OK $VERSION);
+# use vars qw(@EXPORT @EXPORT_OK $VERSION);
 
 my $is_dosish;
 my $is_vms;
 
 BEGIN {
     require Exporter;
-    @EXPORT = ();
-    @EXPORT_OK = qw(AUTOLOAD);
+    @EXPORT = @EXPORT = ();
+    @EXPORT_OK = @EXPORT_OK = qw(AUTOLOAD);
     $is_dosish = $^O eq 'dos' || $^O eq 'os2' || $^O eq 'MSWin32';
     $is_vms = $^O eq 'VMS';
-    $VERSION = '5.56';
+    $VERSION = '5.57';
 }
 
 AUTOLOAD {
@@ -103,7 +103,10 @@ sub import {
     # Export symbols, but not by accident of inheritance.
     #
 
-    Exporter::export $pkg, $callpkg, @_ if $pkg eq 'AutoLoader';
+    if ($pkg eq 'AutoLoader') {
+      local $Exporter::ExportLevel = 1;
+      Exporter::import $pkg, @_;
+    }
 
     #
     # Try to find the autosplit index file.  Eg., if the call package
@@ -219,14 +222,13 @@ lines:
 
     use AutoLoader;
     use Carp;
-    use Errno;
 
     sub AUTOLOAD {
         my $sub = $AUTOLOAD;
         (my $constname = $sub) =~ s/.*:://;
         my $val = constant($constname, @_ ? $_[0] : 0);
         if ($! != 0) {
-            if ($!{EINVAL} || $! =~ /Invalid/) {
+            if ($! =~ /Invalid/ || $!{EINVAL}) {
                 $AutoLoader::AUTOLOAD = $sub;
                 goto &AutoLoader::AUTOLOAD;
             }