in reply to Using modules with relative paths

I'm not sure if I'm missing some caveats, but I usually attack problems like this by pushing values into the @INC array in a BEGIN block. The code below assumes that the script name (or any directory names) won't contain slashes (/).

#!/usr/bin/perl -w BEGIN { $0=~s#/?[^/]*$##; $0 ||= '.'; push @INC,$0.'/../perl_modules'; } print "$_\n" for @INC;