--- ./ext/Digest/SHA/bin/shasum.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./ext/Digest/SHA/bin/shasum	2016-08-04 12:04:16.969910449 +0000
@@ -70,6 +70,7 @@ L<Digest::SHA::PurePerl>.
 
 =cut
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use FileHandle;
 use Getopt::Long;
--- ./ext/Encode/Encode.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./ext/Encode/Encode.pm	2016-08-04 12:04:16.969910449 +0000
@@ -50,7 +50,11 @@ use Encode::Alias;
 our %Encoding;
 our %ExtModule;
 require Encode::Config;
-eval { require Encode::ConfigLocal };
+eval { 
+    local @INC = @INC;
+    pop @INC if $INC[-1] eq '.';
+    require Encode::ConfigLocal
+};
 
 sub encodings {
     my $class = shift;
--- ./ext/Encode/bin/enc2xs.orig	2016-08-04 12:04:04.985910470 +0000
+++ ./ext/Encode/bin/enc2xs	2016-08-04 12:04:16.970910449 +0000
@@ -4,6 +4,7 @@ BEGIN {
     # with $ENV{PERL_CORE} set
     # In case we need it in future...
     require Config; import Config;
+    pop @INC if $INC[-1] eq '.';
 }
 use strict;
 use warnings;
--- ./ext/Encode/bin/piconv.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./ext/Encode/bin/piconv	2016-08-04 12:04:16.970910449 +0000
@@ -1,6 +1,7 @@
 #!./perl
 # $Id: piconv,v 2.3 2007/04/06 12:53:41 dankogai Exp $
 #
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use 5.8.0;
 use strict;
 use Encode ;
--- ./ext/Encode/bin/ucmlint.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./ext/Encode/bin/ucmlint	2016-08-04 12:04:16.971910449 +0000
@@ -3,6 +3,7 @@
 # $Id: ucmlint,v 2.1 2006/05/03 18:24:10 dankogai Exp $
 #
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 our  $VERSION = do { my @r = (q$Revision: 2.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
 
--- ./ext/Encode/bin/unidump.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./ext/Encode/bin/unidump	2016-08-04 12:04:16.971910449 +0000
@@ -1,5 +1,6 @@
 #!./perl
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use Encode;
 use Getopt::Std;
--- ./ext/IO/IO.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./ext/IO/IO.pm	2016-08-04 12:04:16.971910449 +0000
@@ -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 $@;
 }
--- ./ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm	2016-08-04 12:04:16.972910449 +0000
@@ -27,6 +27,8 @@ Exporter::export_ok_tags('all');
 
 BEGIN
 {
+   local @INC = @INC;
+   pop @INC if $INC[-1] eq '.';
    eval ' use IO::Uncompress::Adapter::Inflate 2.008 ;';
    eval ' use IO::Uncompress::Adapter::Bunzip2 2.008 ;';
    eval ' use IO::Uncompress::Adapter::LZO 2.008 ;';
--- ./ext/Storable/Storable.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./ext/Storable/Storable.pm	2016-08-04 12:04:16.972910449 +0000
@@ -32,6 +32,8 @@ $VERSION = '2.18';
 
 {
     local $SIG{__DIE__};
+    local @INC = @INC;
+    pop @INC if $INC[-1] eq '.';
     eval "use Log::Agent";
 }
 
--- ./ext/Sys/Syslog/Syslog.pm.orig	2016-08-04 12:04:05.014910470 +0000
+++ ./ext/Sys/Syslog/Syslog.pm	2016-08-04 12:04:16.973910449 +0000
@@ -112,6 +112,8 @@ EVENTLOG: {
     # some applications are trying to be too smart
     # yes I'm speaking of YOU, SpamAssassin, grr..
     local($SIG{__DIE__}, $SIG{__WARN__}, $@);
+    local @INC = @INC;
+    pop @INC if $INC[-1] eq '.';
 
     if (eval "use Sys::Syslog::Win32; 1") {
         unshift @connectMethods, 'eventlog';
@@ -237,6 +239,8 @@ sub setlogsock {
         @connectMethods = qw(native);
 
     } elsif (lc $setsock eq 'eventlog') {
+        local @INC = @INC;
+        pop @INC if $INC[-1] eq '.';
         if (eval "use Win32::EventLog; 1") {
             @connectMethods = qw(eventlog);
         } else {
--- ./lib/Archive/Tar/bin/ptar.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/Archive/Tar/bin/ptar	2016-08-04 12:04:16.973910449 +0000
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 use strict;
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use Getopt::Std;
 use Archive::Tar;
 use File::Find;
--- ./lib/Archive/Tar/bin/ptardiff.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/Archive/Tar/bin/ptardiff	2016-08-04 12:04:16.973910449 +0000
@@ -1,5 +1,6 @@
 #!/usr/bin/perl
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use Archive::Tar;
 use Getopt::Std;
--- ./lib/Digest.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/Digest.pm	2016-08-04 12:04:16.974910449 +0000
@@ -34,6 +34,8 @@ sub new
 	($class, @args) = @$class if ref($class);
 	no strict 'refs';
 	unless (exists ${"$class\::"}{"VERSION"}) {
+	    local @INC = @INC;
+	    pop @INC if $INC[-1] eq '.';
 	    eval "require $class";
 	    if ($@) {
 		$err ||= $@;
--- ./lib/ExtUtils/instmodsh.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/ExtUtils/instmodsh	2016-08-04 12:04:16.974910449 +0000
@@ -1,5 +1,6 @@
 #!/usr/bin/perl -w
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use IO::File;
 use ExtUtils::Packlist;
--- ./lib/File/Fetch.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/File/Fetch.pm	2016-08-04 12:04:16.975910449 +0000
@@ -511,6 +511,8 @@ sub _lwp_fetch {
 
     };
 
+    local @INC = @INC;
+    pop @INC if $INC[-1] eq '.';
     if( can_load(modules => $use_list) ) {
 
         ### setup the uri object
@@ -560,8 +562,12 @@ sub _netftp_fetch {
     check( $tmpl, \%hash ) or return;
 
     ### required modules ###
+    local @INC = @INC;
+    pop @INC if $INC[-1] eq '.';
     my $use_list = { 'Net::FTP' => 0 };
 
+    local @INC = @INC;
+    pop @INC if $INC[-1] eq '.';
     if( can_load( modules => $use_list ) ) {
 
         ### make connection ###
--- ./lib/File/Spec/Cygwin.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/File/Spec/Cygwin.pm	2016-08-04 12:04:16.975910449 +0000
@@ -128,7 +128,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;
--- ./lib/File/Spec/Win32.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/File/Spec/Win32.pm	2016-08-04 12:04:16.975910449 +0000
@@ -88,7 +88,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;
--- ./lib/I18N/LangTags/Detect.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/I18N/LangTags/Detect.pm	2016-08-04 12:04:16.976910449 +0000
@@ -144,6 +144,8 @@ sub _try_use {   # Basically a wrapper a
   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($@) {
--- ./lib/IPC/Cmd.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/IPC/Cmd.pm	2016-08-04 12:04:16.976910449 +0000
@@ -103,6 +103,8 @@ sub can_use_ipc_run     {
     return if IS_WIN98;
 
     ### if we dont have ipc::run, we obviously can't use it.
+    local @INC = @INC;
+    pop @INC if $INC[-1] eq '.';
     return unless can_load(
                         modules => { 'IPC::Run' => '0.55' },        
                         verbose => ($WARN && $verbose),
--- ./lib/Locale/Maketext.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/Locale/Maketext.pm	2016-08-04 12:04:16.977910449 +0000
@@ -408,6 +408,8 @@ sub _try_use {   # Basically a wrapper a
     DEBUG and print " About to use $module ...\n";
     {
         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($@) {
--- ./lib/Locale/Maketext/Simple.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/Locale/Maketext/Simple.pm	2016-08-04 12:04:16.977910449 +0000
@@ -130,7 +130,12 @@ sub load_loc {
     my $pkg = join('::', grep { defined and length } $args{Class}, $args{Subclass});
     return $Loc{$pkg} if exists $Loc{$pkg};
 
-    eval { require Locale::Maketext::Lexicon; 1 }   or return;
+    eval {
+        local @INC = @INC;
+        pop @INC if $INC[-1] eq '.';
+        require Locale::Maketext::Lexicon;
+        1
+    } or return;
     $Locale::Maketext::Lexicon::VERSION > 0.20	    or return;
     eval { require File::Spec; 1 }		    or return;
 
--- ./lib/Memoize.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/Memoize.pm	2016-08-04 12:04:16.978910449 +0000
@@ -187,7 +187,11 @@ sub _my_tie {
   }
   my $modulefile = $module . '.pm';
   $modulefile =~ s{::}{/}g;
-  eval { require $modulefile };
+  eval {
+    local @INC = @INC;
+    pop @INC if $INC[-1] eq '.';
+    require $modulefile 
+  };
   if ($@) {
     croak "Memoize: Couldn't load hash tie module `$module': $@; aborting";
   }
--- ./lib/Module/CoreList/bin/corelist.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/Module/CoreList/bin/corelist	2016-08-04 12:04:16.978910449 +0000
@@ -71,6 +71,7 @@ requested perl versions.
 
 =cut
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use Module::CoreList;
 use Getopt::Long;
 use Pod::Usage;
--- ./lib/Net/Config.pm.orig	2016-08-04 12:04:04.993910470 +0000
+++ ./lib/Net/Config.pm	2016-08-04 12:04:16.978910449 +0000
@@ -15,7 +15,12 @@ use strict;
 @ISA     = qw(Net::LocalCfg Exporter);
 $VERSION = "1.11";
 
-eval { local $SIG{__DIE__}; require Net::LocalCfg };
+eval {
+  local @INC = @INC;
+  pop @INC if $INC[-1] eq '.';
+  local $SIG{__DIE__};
+  require Net::LocalCfg
+};
 
 %NetConfig = (
   nntp_hosts      => [],
--- ./lib/Net/Ping.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/Net/Ping.pm	2016-08-04 12:04:16.979910449 +0000
@@ -393,7 +393,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);
 }
--- ./lib/Pod/Perldoc.pm.orig	2016-08-04 12:04:05.008910470 +0000
+++ ./lib/Pod/Perldoc.pm	2016-08-04 12:04:16.980910449 +0000
@@ -454,6 +454,9 @@ sub find_good_formatter_class {
   my @class_list = @{ $self->{'formatter_classes'} || [] };
   die "WHAT?  Nothing in the formatter class list!?" unless @class_list;
   
+  local @INC = @INC;
+  pop @INC if $INC[-1] eq '.';
+
   my $good_class_found;
   foreach my $c (@class_list) {
     DEBUG > 4 and print "Trying to load $c...\n";
@@ -842,6 +845,8 @@ sub pod_dirs { # @dirs = pod_dirs($trans
 sub add_translator { # $self->add_translator($lang);
     my $self = shift;
     for my $lang (@_) {
+        local @INC = @INC;
+        pop @INC if $INC[-1] eq '.';
         my $pack = 'POD2::' . uc($lang);
         eval "require $pack";
         if ( $@ ) {
--- ./lib/Test.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/Test.pm	2016-08-04 12:04:16.980910449 +0000
@@ -481,7 +481,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
--- ./lib/Test/Harness/bin/prove.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/Test/Harness/bin/prove	2016-08-04 12:04:16.981910449 +0000
@@ -1,5 +1,6 @@
 #!/usr/bin/perl -w
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 
 use Test::Harness;
--- ./lib/bigint.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/bigint.pm	2016-08-04 12:04:16.981910449 +0000
@@ -231,6 +231,8 @@ sub import
     # see if we can find Math::BigInt::Lite
     if (!defined $a && !defined $p)		# rounding won't work to well
       {
+      local @INC = @INC;
+      pop @INC if $INC[-1] eq '.';
       eval 'require Math::BigInt::Lite;';
       if ($@ eq '')
         {
--- ./lib/bignum.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/bignum.pm	2016-08-04 12:04:16.982910449 +0000
@@ -183,6 +183,8 @@ sub import
     # see if we can find Math::BigInt::Lite
     if (!defined $a && !defined $p)		# rounding won't work to well
       {
+      local @INC = @INC;
+      pop @INC if $INC[-1] eq '.';
       eval 'require Math::BigInt::Lite;';
       if ($@ eq '')
         {
--- ./lib/bigrat.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ ./lib/bigrat.pm	2016-08-04 12:04:16.983910449 +0000
@@ -175,6 +175,8 @@ sub import
     # see if we can find Math::BigInt::Lite
     if (!defined $a && !defined $p)             # rounding won't work to well
       {
+      local @INC = @INC;
+      pop @INC if $INC[-1] eq '.';
       eval 'require Math::BigInt::Lite;';
       if ($@ eq '')
         {
--- ./pod/pod2html.PL.orig	2007-12-18 10:47:08.000000000 +0000
+++ ./pod/pod2html.PL	2016-08-04 12:04:16.983910449 +0000
@@ -172,6 +172,7 @@ This program is distributed under the Ar
 
 =cut
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use Pod::Html;
 
 pod2html @ARGV;
--- ./utils/c2ph.PL.orig	2007-12-18 10:47:08.000000000 +0000
+++ ./utils/c2ph.PL	2016-08-04 12:04:16.984910449 +0000
@@ -280,6 +280,7 @@ Anyway, here it is.  Should run on perl
 
 $RCSID = '$Id: c2ph,v 1.7 95/10/28 10:41:47 tchrist Exp Locker: tchrist $';
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use File::Temp;
 
 ######################################################################
--- ./utils/h2ph.PL.orig	2016-08-04 12:04:05.022910470 +0000
+++ ./utils/h2ph.PL	2016-08-04 12:04:16.984910449 +0000
@@ -36,6 +36,8 @@ $Config{startperl}
 
 print OUT <<'!NO!SUBS!';
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
+
 use strict;
 
 use Config;
--- ./utils/h2xs.PL.orig	2007-12-18 10:47:08.000000000 +0000
+++ ./utils/h2xs.PL	2016-08-04 12:04:16.985910449 +0000
@@ -35,6 +35,8 @@ $Config{startperl}
 
 print OUT <<'!NO!SUBS!';
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
+
 use warnings;
 
 =head1 NAME
--- ./utils/libnetcfg.PL.orig	2007-12-18 10:47:08.000000000 +0000
+++ ./utils/libnetcfg.PL	2016-08-04 12:04:16.985910449 +0000
@@ -97,6 +97,7 @@ Jarkko Hietaniemi, conversion into libne
 
 # $Id: Configure,v 1.8 1997/03/04 09:22:32 gbarr Exp $
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use IO::File;
 use Getopt::Std;
--- ./utils/perlbug.PL.orig	2016-08-04 12:04:04.991910470 +0000
+++ ./utils/perlbug.PL	2016-08-04 12:04:16.986910449 +0000
@@ -81,6 +81,7 @@ my \@patches = (
 
 print OUT <<'!NO!SUBS!';
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use Config;
 use File::Spec;		# keep perlbug Perl 5.005 compatible
 use Getopt::Std;
--- ./utils/perldoc.PL.orig	2007-12-18 10:47:08.000000000 +0000
+++ ./utils/perldoc.PL	2016-08-04 12:04:16.986910449 +0000
@@ -44,7 +44,10 @@ $Config{startperl}
 # This "$file" file was generated by "$0"
 
 require 5;
-BEGIN { \$^W = 1 if \$ENV{'PERLDOCDEBUG'} }
+BEGIN {
+    \$^W = 1 if \$ENV{'PERLDOCDEBUG'};
+    pop \@INC if \$INC[-1] eq '.';
+}
 use Pod::Perldoc;
 exit( Pod::Perldoc->run() );
 
--- ./utils/perlivp.PL.orig	2007-12-18 10:47:08.000000000 +0000
+++ ./utils/perlivp.PL	2016-08-04 12:04:16.986910449 +0000
@@ -39,6 +39,8 @@ print OUT "\n# perlivp $^V\n";
 
 print OUT <<'!NO!SUBS!';
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
+
 sub usage {
     warn "@_\n" if @_;
     print << "    EOUSAGE";
--- ./utils/splain.PL.orig	2007-12-18 10:47:08.000000000 +0000
+++ ./utils/splain.PL	2016-08-04 12:04:16.987910449 +0000
@@ -38,6 +38,12 @@ $Config{startperl}
 	if \$running_under_some_shell;
 !GROK!THIS!
 
+print OUT <<'!NO!SUBS!';
+
+BEGIN { pop @INC if $INC[-1] eq '.' }
+
+!NO!SUBS!
+
 while (<IN>) {
     print OUT unless /^package diagnostics/;
 }
