small bug in change#6144; remove random \xA0 character that snuck
[p5sagit/p5-mst-13.2.git] / lib / AutoLoader.pm
index 66c764f..8fd7d3b 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 {
@@ -35,7 +36,7 @@ AUTOLOAD {
        my ($pkg,$func) = ($sub =~ /(.*)::([^:]+)$/);
        $pkg =~ s#::#/#g;
        if (defined($filename = $INC{"$pkg.pm"})) {
-           $filename =~ s#^(.*)$pkg\.pm$#$1auto/$pkg/$func.al#;
+           $filename =~ s#^(.*)$pkg\.pm\z#$1auto/$pkg/$func.al#s;
 
            # if the file exists, then make sure that it is a
            # a fully anchored path (i.e either '/usr/lib/auto/foo/bar.al',
@@ -44,9 +45,9 @@ AUTOLOAD {
            # looked for 'lib/lib/auto/foo/bar.al', given @INC = ('lib').
 
            if (-r $filename) {
-               unless ($filename =~ m|^/|) {
+               unless ($filename =~ m|^/|s) {
                    if ($is_dosish) {
-                       unless ($filename =~ m{^([a-z]:)?[\\/]}i) {
+                       unless ($filename =~ m{^([a-z]:)?[\\/]}is) {
                             $filename = "./$filename";
                        }
                    }
@@ -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