This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
document Git_Data
[perl5.git] / lib / AutoLoader.pm
index 636bb5a..e05372f 100644 (file)
@@ -15,7 +15,7 @@ BEGIN {
     $is_epoc = $^O eq 'epoc';
     $is_vms = $^O eq 'VMS';
     $is_macos = $^O eq 'MacOS';
-    $VERSION = '5.64_01';
+    $VERSION = '5.68';
 }
 
 AUTOLOAD {
@@ -155,17 +155,20 @@ sub import {
     (my $calldir = $callpkg) =~ s#::#/#g;
     my $path = $INC{$calldir . '.pm'};
     if (defined($path)) {
-       # Try absolute path name.
+       # Try absolute path name, but only eval it if the
+        # transformation from module path to autosplit.ix path
+        # succeeded!
+       my $replaced_okay;
        if ($is_macos) {
            (my $malldir = $calldir) =~ tr#/#:#;
-           $path =~ s#^(.*)$malldir\.pm\z#$1auto:$malldir:autosplit.ix#s;
+           $replaced_okay = ($path =~ s#^(.*)$malldir\.pm\z#$1auto:$malldir:autosplit.ix#s);
        } else {
-           $path =~ s#^(.*)$calldir\.pm\z#$1auto/$calldir/autosplit.ix#;
+           $replaced_okay = ($path =~ s#^(.*)$calldir\.pm\z#$1auto/$calldir/autosplit.ix#);
        }
 
-       eval { require $path; };
+       eval { require $path; } if $replaced_okay;
        # If that failed, try relative path with normal @INC searching.
-       if ($@) {
+       if (!$replaced_okay or $@) {
            $path ="auto/$calldir/autosplit.ix";
            eval { require $path; };
        }
@@ -373,7 +376,8 @@ can benefit from bug fixes.
 This package has the same copyright and license as the perl core:
 
              Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-        2000, 2001, 2002, 2003, 2004, 2005, 2006 by Larry Wall and others
+        2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+        by Larry Wall and others
     
                            All rights reserved.