Subject: Re: Perl CPAN module help
From: [email-masked] (Peter J. Acklam)
To: "Gary Nielson" <[email-masked]>
Cc: "Peter J. Acklam" <[email-masked]>, <[email-masked]>
Date: Mon, 17 Nov 2003 11:12:47 +0100

"Gary Nielson" <[email-masked]> wrote:

> Thank you for your help. I understand what you are saying
> here. I will try installing under /usr/local.

I forgot to mention that Perl will not, by default, search for
modules in /usr/local.  This is a disadvantage, but it's worth it,
in my opinion.  The simplest way to make Perl look for modules
there is to add

   PERL5LIB=/usr/local/lib/perl5:/usr/local/lib/perl5/site_perl

to your personal startup file (~/.bash_profile or whatever).

> My question, though, is what do I do about all the modules I've
> installed under /usr?  How do I deal with them?  Do I need to
> re-install them under /usr/local? Do I then need to somehow
> remove them from /usr? Or can I have modules under both
> directories, leaving the ones that work under /usr and place new
> ones under /usr/local?

If they're working properly, you might as well leave them alone.
If they're broken, re-install them with PREFIX=/usr/local.

Note that perl will search the directories specified in PERL5LIB
before the other directories, so if you have a working module
under /usr/local and a broken one under /usr, then the working one
under /usr/local will be used.  The default search path:

    $ unset PERL5LIB
    $ perl -wle 'print for @INC'
    /usr/lib/perl5/5.8.0/cygwin-multi-64int
    /usr/lib/perl5/5.8.0
    /usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64int
    /usr/lib/perl5/site_perl/5.8.0
    /usr/lib/perl5/site_perl
    .

Now, note how /usr/local/... comes first:

    $ export PERL5LIB=/usr/local/lib/perl5:/usr/local/lib/perl5/site_perl
    $ perl -wle 'print for @INC'
    /usr/local/lib/perl5/5.8.0/cygwin-multi-64int
    /usr/local/lib/perl5/5.8.0
    /usr/local/lib/perl5
    /usr/local/lib/perl5/site_perl/5.8.0/cygwin-multi-64int
    /usr/local/lib/perl5/site_perl/5.8.0
    /usr/local/lib/perl5/site_perl
    /usr/lib/perl5/5.8.0/cygwin-multi-64int
    /usr/lib/perl5/5.8.0
    /usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64int
    /usr/lib/perl5/site_perl/5.8.0
    /usr/lib/perl5/site_perl
    .

You may try to remove modules under /usr, but be careful so you
don't remove things you need.  If you really want to remove them,
I'd rather do that by uninstalling Perl, removing everything under
/usr/lib/perl5 and start over with a clean Perl installation.

Peter

-- 
Peter J. Acklam - [email-masked] - http://home.online.no/~pjacklam

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/