ActiveState Community

How to update INC?

Posted by SaltyFoam on 2008-07-03 13:19

I would like to add a directory to the Perl library path so that it'll find my files there. How do I modify the ActivePerl @INC? I thought I would find this in the system registry or configuration file but haven't found it.

gangabass | Sun, 2008-07-06 19:15

use lib '/home/user/directory';

Antonski | Mon, 2008-07-14 04:30

If you use your own modules stored in the project tree, you can use relative paths, for example:

use FindBin;
use lib "$FindBin::Bin/../mylib";

or even

use FindBin qw($Bin);
use lib "$Bin/../mylib";

Cheers