Perl @INC

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello, I am trying to change the @INC array, we are running perl
v5.8.4 on Solaris 10, and our sys admin has "/usr/" mounted read only
so I can't install any perl modules there. He wants me to install all
perl modules under /opt/csw/perl/lib, if I add "use lib '/opt/csw/perl/
lib/';" to a script I can get our scripts to work correctly, however
it just isn't practical for me to modify all of them. I really want to
avoid editing any of them, I would like to know if there a way to
change @INC globally so I don't have to make any modification? Also
all CPAN don't want to let chose the install directory, how can I fix
it so the modules will install themselves in /opt/csw/perl/lib?

Re: Perl @INC

Quoted text here. Click to load it

Ok I've figured out how to build and install the CPAN modules, I used
"perl Makefile.PL PREFIX=/opt/csw/perl", then I just built and
installed the module as normal. I still have the original problem of
@INC not containing my module path, this also means that all CPAN
modules with newly install dependencies won't build or install.

Re: Perl @INC

Sparcler wrote:
Quoted text here. Click to load it

     perldoc -q @INC

Gunnar Hjalmarsson

Re: Perl @INC

Quoted text here. Click to load it

set the PERL5LIB environment variable, like is says in the answer
to your FAQ:

    perldoc -q module

        How do I keep my own module/library directory?

Quoted text here. Click to load it

    perldoc CPAN

        I am not root, how can I install a module in a personal directory?

Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher0cmdat/"

Re: Perl @INC

Tad J McClellan wrote:

Quoted text here. Click to load it

That's only global to one user, so not all that useful in any shared

And it *is* global, so applies to *all* instances of perl that you run,
which may not be what you want.

You can always write a very simple program to add command line options then
exec the perl you want.  You can then use that executable in #! lines.

              Just because I've written it doesn't mean that
                   either you or I have to believe it.

Site Timeline