D:\tmp\pm>type findbin_taint.pl use strict; use warnings; use FindBin qw($RealBin); my $my_lib; BEGIN { $RealBin =~ m/(.+)/; # just a demo, you should only accept a safe path $my_lib = "$1/../lib"; } use lib $my_lib; print join"\n",@INC; use PadWalker; # no matter what you use will fail if @INC has a tainted entry D:\tmp\pm>perl -T findbin_taint.pl D:/tmp/pm/../lib C:/Strawberry/perl/site/lib/MSWin32-x64-multi-thread C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib D:\tmp\pm>