summaryrefslogtreecommitdiff
path: root/lib/AutoLoader.pm
diff options
context:
space:
mode:
authorSteffen Mueller <wyp3rlx02@sneakemail.com>2008-09-05 15:56:01 +0200
committerNicholas Clark <nick@ccl4.org>2008-09-05 21:03:46 +0000
commit6ada912ce2ec33f8cd53bfc96056ec8617e4a08e (patch)
tree37c60d4c1ad671d2ba22f1bc46c5cd48c03c46dc /lib/AutoLoader.pm
parent598d6e99fadb6f0e660491546091a7130ff8a2e9 (diff)
downloadperl-6ada912ce2ec33f8cd53bfc96056ec8617e4a08e.tar.gz
bugfix, AutoLoader 0.67
Message-ID: <20080905115602.23307.qmail@lists.develooper.com> Date: Fri, 05 Sep 2008 13:56:01 +0200 p4raw-id: //depot/perl@34282
Diffstat (limited to 'lib/AutoLoader.pm')
-rw-r--r--lib/AutoLoader.pm15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/AutoLoader.pm b/lib/AutoLoader.pm
index 880acd18f8..0129002959 100644
--- a/lib/AutoLoader.pm
+++ b/lib/AutoLoader.pm
@@ -15,7 +15,7 @@ BEGIN {
$is_epoc = $^O eq 'epoc';
$is_vms = $^O eq 'VMS';
$is_macos = $^O eq 'MacOS';
- $VERSION = '5.66';
+ $VERSION = '5.67';
}
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; };
}