http://www.perlmonks.org?node_id=1021955


in reply to Add directry to @INC system wide

kielstirling ++

I am also using the same method, here it is,

use File::Spec::Functions qw(catdir splitdir canonpath); use FindBin qw($RealBin); BEGIN { my @dirs = splitdir(canonpath($RealBin)); my($path) = grep { -e $_ } ( map { $_ = catdir(@dirs[0 .. $#dirs - + $_]).'/bin/new/' } (0 .. $#dirs) ); unshift(@INC, $RealBin, $path); }