in reply to Path to my modules

How I can in main program set path to my modules?

Replies are listed 'Best First'.
Re^2: Path to my modules
by Khariton (Sexton) on Dec 14, 2010 at 21:42 UTC
    1.lib method will be work with Strawberry Perl? Now I can't test this, because I can't use Windows for 2 days. I will be far away from it.
    2.if I use this:
    use lib 'my/mymodulespath';
    then system @INC will be changed.
    I want use my modules without changing global system variables.
    This modules need only for my program!
    3. can I use some like next?
    use mymodules/mymodule;
      then system @INC will be changed.
      I want use my modules without changing global system variables.

      The @INC array isn't global to the system, but rather local to every Perl program. So, no worries. And yes, it works with Strawberry, too.

      use lib 'my/mymodulespath';

      A small tip, you might like to consider using absolute path names rather than relative. The path given will be relative to the current directory when the program is run, which is often not the same as the directory in which the script is stored. For example:
      use 'C:/program/lib/module';