If you've modified ~/.bashrc
and it hasn't added it to your environment, then you are probably adding it to your PATH
. The best way to do this is to use the PERL5LIB
environment variable.
If you want to do this at the start of each shell session no matter what is going on, add the following line to ~/.bashrc
(assuming that the shell is bash) and the source the script or start a new shell session.
export PERL5LIB=/path/to/module
If you want to do it only in that script, add the following line after the shebang:
use lib '/path/to/module';
If you just want to do it as fast as possible, run the script with perl -I
perl -I /path/to/module script.pl
All of these methods will prepend the directory containing the module to @INC