summaryrefslogtreecommitdiff
path: root/cpan/Module-Load-Conditional/lib/Module
diff options
context:
space:
mode:
Diffstat (limited to 'cpan/Module-Load-Conditional/lib/Module')
-rw-r--r--cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm b/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm
index cff442dcb8..f110e53626 100644
--- a/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm
+++ b/cpan/Module-Load-Conditional/lib/Module/Load/Conditional.pm
@@ -18,7 +18,7 @@ BEGIN {
$FIND_VERSION $ERROR $CHECK_INC_HASH];
use Exporter;
@ISA = qw[Exporter];
- $VERSION = '0.40';
+ $VERSION = '0.42';
$VERBOSE = 0;
$DEPRECATED = 0;
$FIND_VERSION = 1;
@@ -204,6 +204,8 @@ sub check_install {
if ( ref $dir ) {
### @INC hook -- we invoke it and get the filehandle back
### this is actually documented behaviour as of 5.8 ;)
+
+ my $existed_in_inc = $INC{$file_inc};
if (UNIVERSAL::isa($dir, 'CODE')) {
($fh) = $dir->($dir, $file);
@@ -222,6 +224,8 @@ sub check_install {
}
$filename = $INC{$file_inc} || $file;
+
+ delete $INC{$file_inc} if not $existed_in_inc;
} else {
$filename = File::Spec->catfile($dir, $file);