summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dist/I18N-LangTags/lib/I18N/LangTags/Detect.pm2
-rw-r--r--dist/IO/IO.pm2
-rw-r--r--dist/Locale-Maketext/lib/Locale/Maketext.pm2
-rw-r--r--dist/Net-Ping/lib/Net/Ping.pm6
-rw-r--r--dist/PathTools/Cwd.pm5
-rw-r--r--dist/PathTools/lib/File/Spec/Cygwin.pm6
-rw-r--r--dist/PathTools/lib/File/Spec/VMS.pm5
-rw-r--r--dist/PathTools/lib/File/Spec/Win32.pm6
-rw-r--r--dist/Storable/Storable.pm8
-rw-r--r--dist/Test/lib/Test.pm7
-rw-r--r--dist/base/lib/base.pm6
11 files changed, 47 insertions, 8 deletions
diff --git a/dist/I18N-LangTags/lib/I18N/LangTags/Detect.pm b/dist/I18N-LangTags/lib/I18N/LangTags/Detect.pm
index f13d5460b3..e9c3aaab58 100644
--- a/dist/I18N-LangTags/lib/I18N/LangTags/Detect.pm
+++ b/dist/I18N-LangTags/lib/I18N/LangTags/Detect.pm
@@ -145,6 +145,8 @@ sub _try_use { # Basically a wrapper around "require Modulename"
print " About to use $module ...\n" if DEBUG;
{
local $SIG{'__DIE__'};
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
eval "require $module"; # used to be "use $module", but no point in that.
}
if($@) {
diff --git a/dist/IO/IO.pm b/dist/IO/IO.pm
index de3e991a90..833f1a2358 100644
--- a/dist/IO/IO.pm
+++ b/dist/IO/IO.pm
@@ -18,6 +18,8 @@ sub import {
my @l = @_ ? @_ : qw(Handle Seekable File Pipe Socket Dir);
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
eval join("", map { "require IO::" . (/(\w+)/)[0] . ";\n" } @l)
or croak $@;
}
diff --git a/dist/Locale-Maketext/lib/Locale/Maketext.pm b/dist/Locale-Maketext/lib/Locale/Maketext.pm
index 823c8d7647..0c99641c43 100644
--- a/dist/Locale-Maketext/lib/Locale/Maketext.pm
+++ b/dist/Locale-Maketext/lib/Locale/Maketext.pm
@@ -499,6 +499,8 @@ sub _try_use { # Basically a wrapper around "require Modulename"
local $SIG{'__DIE__'};
local $@;
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
eval "require $module"; # used to be "use $module", but no point in that.
if($@) {
diff --git a/dist/Net-Ping/lib/Net/Ping.pm b/dist/Net-Ping/lib/Net/Ping.pm
index 2766c9edbb..c9cbd27356 100644
--- a/dist/Net-Ping/lib/Net/Ping.pm
+++ b/dist/Net-Ping/lib/Net/Ping.pm
@@ -410,7 +410,11 @@ sub ping_external {
$timeout # Seconds after which ping times out
) = @_;
- eval { require Net::Ping::External; }
+ eval {
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
+ require Net::Ping::External;
+ }
or croak('Protocol "external" not supported on your system: Net::Ping::External not found');
return Net::Ping::External::ping(ip => $ip, timeout => $timeout);
}
diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm
index e181219be5..e9f9d61143 100644
--- a/dist/PathTools/Cwd.pm
+++ b/dist/PathTools/Cwd.pm
@@ -40,7 +40,10 @@ if ($^O eq 'os2') {
my $use_vms_feature;
BEGIN {
if ($^O eq 'VMS') {
- if (eval { local $SIG{__DIE__}; require VMS::Feature; }) {
+ if (eval { local $SIG{__DIE__};
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
+ require VMS::Feature; }) {
$use_vms_feature = 1;
}
}
diff --git a/dist/PathTools/lib/File/Spec/Cygwin.pm b/dist/PathTools/lib/File/Spec/Cygwin.pm
index d8d532eeae..e137507c4b 100644
--- a/dist/PathTools/lib/File/Spec/Cygwin.pm
+++ b/dist/PathTools/lib/File/Spec/Cygwin.pm
@@ -137,7 +137,11 @@ sub case_tolerant {
if ($mntopts and ($mntopts =~ /,managed/)) {
return 0;
}
- eval { require Win32API::File; } or return 1;
+ eval {
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
+ require Win32API::File;
+ } or return 1;
my $osFsType = "\0"x256;
my $osVolName = "\0"x256;
my $ouFsFlags = 0;
diff --git a/dist/PathTools/lib/File/Spec/VMS.pm b/dist/PathTools/lib/File/Spec/VMS.pm
index a4b1d89a98..40bc08a020 100644
--- a/dist/PathTools/lib/File/Spec/VMS.pm
+++ b/dist/PathTools/lib/File/Spec/VMS.pm
@@ -39,7 +39,10 @@ via the C<DECC$FILENAME_UNIX_REPORT> CRTL feature.
my $use_feature;
BEGIN {
- if (eval { local $SIG{__DIE__}; require VMS::Feature; }) {
+ if (eval { local $SIG{__DIE__};
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
+ require VMS::Feature; }) {
$use_feature = 1;
}
}
diff --git a/dist/PathTools/lib/File/Spec/Win32.pm b/dist/PathTools/lib/File/Spec/Win32.pm
index 280e8ec986..d81028304d 100644
--- a/dist/PathTools/lib/File/Spec/Win32.pm
+++ b/dist/PathTools/lib/File/Spec/Win32.pm
@@ -90,7 +90,11 @@ Default: 1
=cut
sub case_tolerant {
- eval { require Win32API::File; } or return 1;
+ eval {
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
+ require Win32API::File;
+ } or return 1;
my $drive = shift || "C:";
my $osFsType = "\0"x256;
my $osVolName = "\0"x256;
diff --git a/dist/Storable/Storable.pm b/dist/Storable/Storable.pm
index c8f6db107d..541776d401 100644
--- a/dist/Storable/Storable.pm
+++ b/dist/Storable/Storable.pm
@@ -25,7 +25,13 @@ use vars qw($canonical $forgive_me $VERSION);
$VERSION = '2.56';
BEGIN {
- if (eval { local $SIG{__DIE__}; require Log::Agent; 1 }) {
+ if (eval {
+ local $SIG{__DIE__};
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
+ require Log::Agent;
+ 1;
+ }) {
Log::Agent->import;
}
#
diff --git a/dist/Test/lib/Test.pm b/dist/Test/lib/Test.pm
index de20922194..d75b0cca60 100644
--- a/dist/Test/lib/Test.pm
+++ b/dist/Test/lib/Test.pm
@@ -505,7 +505,12 @@ sub _diff_complain {
my($result, $expected, $detail, $prefix) = @_;
return _diff_complain_external(@_) if $ENV{PERL_TEST_DIFF};
return _diff_complain_algdiff(@_)
- if eval { require Algorithm::Diff; Algorithm::Diff->VERSION(1.15); 1; };
+ if eval {
+ local @INC = @INC;
+ pop @INC if $INC[-1] eq '.';
+ require Algorithm::Diff; Algorithm::Diff->VERSION(1.15);
+ 1;
+ };
$told_about_diff++ or print $TESTERR <<"EOT";
# $prefix (Install the Algorithm::Diff module to have differences in multiline
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.
#