how do i add my custom perl modules directory path to @inc in windows server?

saratcm
saratcm used Ask the Experts™
on
how do i add my custom perl modules directory path to @inc in windows 2008 server? can adding PERL5LIB environment variable & giving the path of the custom perl module directory to perl5lib env variable solve the problem? Please let me know if any other solutions are possible?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT Consultant
Commented:
Just use the lib module at the top of your script

use lib '/path/to/custome/perl/modules;'

Author

Commented:
I have more than 30 modules in the directory & most modules are called by more than 100 scripts..so will i need to add the use lib statement to all the 100 scripts that call the modules ?  Can't i just specify the env variable & provide the value as the path to the directory?
Kim RyanIT Consultant
Commented:
You can also specify the directory on the command line as a paramter to perl, such as

perl -I /path/to/modules your_script.pl
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

Setting the PERL5LIB env variable definitely works on *nix.  I would think it would work under Windows but I'm not sure.

Author

Commented:
I won't be able to provide the directory path as a parameter to perl,bcos the modules are called by C++ code.Any other sol'n?
Top Expert 2009
Commented:
The env var is the easiest.

You could compile perl from source, and specify and additional include directory then, but this is much more complicated.

Author

Commented:
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial