Upgrade to PathTools 3.25
[p5sagit/p5-mst-13.2.git] / lib / AutoLoader.pm
index e740431..28be69f 100644 (file)
@@ -15,7 +15,7 @@ BEGIN {
     $is_epoc = $^O eq 'epoc';
     $is_vms = $^O eq 'VMS';
     $is_macos = $^O eq 'MacOS';
-    $VERSION = '5.61';
+    $VERSION = '5.63';
 }
 
 AUTOLOAD {
@@ -89,9 +89,11 @@ sub find_filename {
        if (defined($filename = $INC{"$pkg.pm"})) {
            if ($is_macos) {
                $pkg =~ tr#/#:#;
-               $filename =~ s#^(.*)$pkg\.pm\z#$1auto:$pkg:$func.al#s;
+               $filename = undef
+                 unless $filename =~ s#^(.*)$pkg\.pm\z#$1auto:$pkg:$func.al#s;
            } else {
-               $filename =~ s#^(.*)$pkg\.pm\z#$1auto/$pkg/$func.al#s;
+               $filename = undef
+                 unless $filename =~ s#^(.*)$pkg\.pm\z#$1auto/$pkg/$func.al#s;
            }
 
            # if the file exists, then make sure that it is a
@@ -100,7 +102,7 @@ sub find_filename {
            # (and failing) to find the 'lib/auto/foo/bar.al' because it
            # looked for 'lib/lib/auto/foo/bar.al', given @INC = ('lib').
 
-           if (-r $filename) {
+           if (defined $filename and -r $filename) {
                unless ($filename =~ m|^/|s) {
                    if ($is_dosish) {
                        unless ($filename =~ m{^([a-z]:)?[\\/]}is) {