package GetRidOfOracle; # @INC is messed up, so we must not load any other module here. # This includes "strict" and "warnings". sub isOracleDirectory { my $dirname=shift; # We are on Windows. / and \ are equal. Case does not matter. # Change to local conditions as needed. $dirname=~tr|\\|/|; return lc($dirname)=~m|/oracle/|; } # remove Oracle Directories from @INC: @INC=grep { !isOracleDirectory($_) } @INC; 1; #### #!/usr/bin/perl # ^- Change perl path and parameters as needed use GetRidOfOracle; # <-- must be the very first command in the script! use v5.12; use strict; use warnings; # your code here ... # For a demo, set PERL5LIB as Oracle would do, then run this script. # No Oracle directory should be printed as long as GetRidOfOracle is loaded. say for @INC; #### #!/usr/bin/perl # ^- Change perl path and parameters as needed use GetRidOfOracle; # <-- must be the very first command in the script! use strict; use warnings; # your code here ... # For a demo, set PERL5LIB as Oracle would do, then run this script. # No Oracle directory should be printed as long as GetRidOfOracle is loaded. print "$_\n" for @INC;