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

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?
saratcmAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kim RyanIT ConsultantCommented:
Just use the lib module at the top of your script

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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
saratcmAuthor 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?
0
Kim RyanIT ConsultantCommented:
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
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

wilcoxonCommented:
Setting the PERL5LIB env variable definitely works on *nix.  I would think it would work under Windows but I'm not sure.
0
saratcmAuthor 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?
0
Adam314Commented:
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.
0
saratcmAuthor Commented:
Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.