summaryrefslogtreecommitdiff
path: root/dist/base
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-06-23 14:06:40 +1000
committerTony Cook <tony@develop-help.com>2016-07-26 15:36:32 +1000
commit8901ddee94b1bc3764b4278d1cb26bed30bc2605 (patch)
treec8be8c6e8e8204a6dafb13ae1d2119cd4dfee443 /dist/base
parentdcfbcce2b273096853629671e1e3a9c34c7ac7c8 (diff)
downloadperl-8901ddee94b1bc3764b4278d1cb26bed30bc2605.tar.gz
dist/: remove . from @INC when loading optional modules
I didn't update base.pm since that seems more likely to be loading modules *expected* to be in the current directory. Opinions welcome.
Diffstat (limited to 'dist/base')
-rw-r--r--dist/base/lib/base.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/dist/base/lib/base.pm b/dist/base/lib/base.pm
index 6fee6008fc..c95c2dbfab 100644
--- a/dist/base/lib/base.pm
+++ b/dist/base/lib/base.pm
@@ -97,7 +97,11 @@ sub import {
{
local $SIG{__DIE__};
my $fn = _module_to_filename($base);
- eval { require $fn };
+ eval {
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
+ require $fn
+ };
# Only ignore "Can't locate" errors from our eval require.
# Other fatal errors (syntax etc) must be reported.
#