more m//s and $ vs \z fixups (from Greg Bacon)
[p5sagit/p5-mst-13.2.git] / lib / AutoLoader.pm
index 488030a..d62ceb0 100644 (file)
@@ -1,17 +1,18 @@
 package AutoLoader;
 
-use vars qw(@EXPORT @EXPORT_OK $VERSION);
+use 5.005_64;
+our(@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 +104,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
@@ -225,7 +229,7 @@ lines:
         (my $constname = $sub) =~ s/.*:://;
         my $val = constant($constname, @_ ? $_[0] : 0);
         if ($! != 0) {
-            if ($! =~ /Invalid/) {
+            if ($! =~ /Invalid/ || $!{EINVAL}) {
                 $AutoLoader::AUTOLOAD = $sub;
                 goto &AutoLoader::AUTOLOAD;
             }