In perl.git, the branch ap/baseincguard has been updated <http://perl5.git.perl.org/perl.git/commitdiff/335840bed8dfa5f4e948a2e4b1c2c450beda6216?hp=330b15e7bf6c4e0a0e5e5a99ca09d9a404106337>
discards 330b15e7bf6c4e0a0e5e5a99ca09d9a404106337 (commit) - Log ----------------------------------------------------------------- commit 335840bed8dfa5f4e948a2e4b1c2c450beda6216 Author: Aristotle Pagaltzis <[email protected]> Date: Sat Oct 29 08:43:38 2016 +0200 base: only hide $INC[-1] . from optional loads ----------------------------------------------------------------------- Summary of changes: dist/base/lib/base.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/base/lib/base.pm b/dist/base/lib/base.pm index 001085b..9f08ed8 100644 --- a/dist/base/lib/base.pm +++ b/dist/base/lib/base.pm @@ -120,7 +120,7 @@ sub import { # If that happens, it removes the rear hook from @INC to keep # the dot visible. # Note that this setup works recursively: if a module loaded via - # base.pm itself uses bases.pm, there will be one layer of hooks + # base.pm itself uses base.pm, there will be one layer of hooks # in @INC per base::import call frame, and they do not interfere # with each other. my ($reentrant, $front_hook, $rear_hook); @@ -130,10 +130,10 @@ sub import { } require $fn }; - if ($dot_hidden && grep -e && !( -d _ || -b _ ), $fn, $fn.'c') { + if ($dot_hidden && (my @fn = grep -e && !( -d _ || -b _ ), $fn.'c', $fn)) { require Carp; Carp::croak(<<ERROR); -Base class package "$base" is not empty but "$fn" exists in the current directory. +Base class package "$base" is not empty but "$fn[0]" exists in the current directory. To help avoid security issues, base.pm now refuses to load optional modules from the current working directory when it is the last entry in \@INC. If your software worked on previous versions of Perl, the best solution -- Perl5 Master Repository
