As Zefram pointed out in
<https://rt.perl.org/Ticket/Display.html?id=128769#txn-1414015>,
having inconsistent behaviour is going to cause more problems
than solves.
{
local $SIG{__DIE__};
my $fn = _module_to_filename($base);
- my $localinc = $INC[-1] eq '.';
- local @INC = @INC[0..$#INC-1] if $localinc;
+ local @INC = @INC;
+ pop @INC if my $dotty = $INC[-1] eq '.';
eval {
require $fn
};
(Perhaps you need to 'use' the module which defines that package first,
or make that module available in \@INC (\@INC contains: @INC).
ERROR
- if ($localinc && -e $fn) {
+ if ($dotty && -e $fn) {
$e .= <<ERROS;
If you mean to load $fn from the current directory, you may
want to try "use lib '.'".