in reply to Odd "use" problem

How do you add a path to @INC? try it with:
use lib q{/my/path};
or
BEGIN { unshift @INC, "/my/path" }
or set the environment var with
export PERL5LIB="/My/Path"
Boris

Replies are listed 'Best First'.
Re^2: Odd "use" problem
by jfroebe (Parson) on Jun 11, 2004 at 16:21 UTC

    I wonder if there is an easy way to include ${HOME}/lib by default for all users... so using 'use lib (glob("~/lib"))[0]' is unnecessary

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

      Put
      test -r $HOME/lib && export PERL5LIB=$HOME/lib
      in your /etc/profile or /etc/bash.bashrc whatever is executed for every users shell. untested ...
      Boris

        DOH!

        it must be friday

        No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Re^2: Odd "use" problem
by Anonymous Monk on Jun 12, 2004 at 00:25 UTC
    I have used both of the methods you mentioned, the only real difference being that when using "use lib" I have always used
    use lib qw(/a/path /another/path);

    The path is showing up in @INC and the files is in the path but PERL chokes on it every time.