From: Matt S Trout Date: Sun, 6 Dec 2009 19:31:15 +0000 (-0500) Subject: correctly remove %INC entries X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1fe11d3f326809ef5533788cc823f88a01224c53;p=gitmo%2FMooseX-Antlers.git correctly remove %INC entries --- diff --git a/lib/MooseX/Antlers/StealImport.pm b/lib/MooseX/Antlers/StealImport.pm index b961452..404a540 100644 --- a/lib/MooseX/Antlers/StealImport.pm +++ b/lib/MooseX/Antlers/StealImport.pm @@ -34,9 +34,11 @@ sub import { sub unimport { my ($class, @unsteal_classes) = @_; foreach my $unsteal (@unsteal_classes) { + (my $pm_file = $unsteal) =~ s/::/\//g; if (exists $saved_inc{$unsteal}) { - (my $pm_file = $unsteal) =~ s/::/\//g; $INC{"${pm_file}.pm"} = delete $saved_inc{$unsteal}; + } else { + delete $INC{"${pm_file}.pm"}; } if (defined $saved_import{$unsteal}) { {