summaryrefslogtreecommitdiff
path: root/cpan/Memoize
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-06-27 16:21:21 +1000
committerTony Cook <tony@develop-help.com>2016-07-26 15:36:32 +1000
commitb8097e9479a0aafd1182244c6f9a955c57fb6b1a (patch)
treeb2972f3519bf10c282667607773c03c05e443583 /cpan/Memoize
parent38b4af19a42e6a4b9d5c8cc97fd06d954fff69a8 (diff)
downloadperl-b8097e9479a0aafd1182244c6f9a955c57fb6b1a.tar.gz
cpan/: remove . from @INC when loading optional modules
Diffstat (limited to 'cpan/Memoize')
-rw-r--r--cpan/Memoize/Memoize.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpan/Memoize/Memoize.pm b/cpan/Memoize/Memoize.pm
index 9a58c4ac74..b566f21b96 100644
--- a/cpan/Memoize/Memoize.pm
+++ b/cpan/Memoize/Memoize.pm
@@ -184,7 +184,11 @@ sub _my_tie {
}
my $modulefile = $module . '.pm';
$modulefile =~ s{::}{/}g;
- eval { require $modulefile };
+ eval {
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
+ require $modulefile
+ };
if ($@) {
croak "Memoize: Couldn't load hash tie module `$module': $@; aborting";
}