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?
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;'

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 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 ConsultantCommented:
You can also specify the directory on the command line as a paramter to perl, such as

perl -I /path/to/modules
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Setting the PERL5LIB env variable definitely works on *nix.  I would think it would work under Windows but I'm not sure.
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?
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.
saratcmAuthor Commented:
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

From novice to tech pro — start learning today.