This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Perl CPAN module help


Thank you so much. If I wanted to start fresh with a new perl
installation -- replacing the executables and all the modules -- how do you
recommend I do this under cygwin. I hadn't installed too many modules and it
would be nicer to start clean and set it up to use /usr/local right from the
start for everything. I really like setup.exe to install things, it is
sweet.

Thanks again!

-----Original Message-----
From: Peter J. Acklam [mailto:pjacklam@online.no]
Sent: Monday, November 17, 2003 5:13 AM
To: Gary Nielson
Cc: Peter J. Acklam; cygwin@cygwin.com
Subject: Re: Perl CPAN module help


"Gary Nielson" <gary@garynielson.com> 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 - pjacklam@online.no - 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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]