LESSON:

Don't do all 3 of the following for any core modules (unless you know
you want the original version removed from the core install):

a) remove old versions during install (using UNINST=1)
  while
b) installing modules to an alternate location (using
PREFIX=.../LIB=...)
  as
c) root (or same user as the owner of the core installation)

Any two alone should be safe, but all 3 can be hazardous to your sanity!

STORY:

I was having problems a couple of weeks ago getting mod_perl make test
to run - both the test programs and apache itself were complaining about
CGI.pm not being found.  I tried modifying Makefile.PL and
httpd.conf-dist and adding local.pl to t/conf to make it work again
(which it did but wasn't necessary as it turns out).

Well, today I found the source of all my problems...Doh! They were self
inflicted.  Apologies to all on the list for my getting annoyed
(privately) that no-one else had had this problem, or had a clue as to
how to fix it.

I was using cpan to install modules as root, and had UNINST=1 set, which
had the (designed) side effect of uninstalling CGI.pm from the core
distribution when I installed the latest version into my alternate
location.

>From now on I'll leave the core install untouched, and install all my
add-on modules as a non-root user just to be safe.

Once I reinstalled perl (just re-ran last make install from source
tree), the mod_perl test suite ran just fine (unmodified version 1.26).
I also added PREFIX and LIB to my makepl_args.mod_perl file rather than
having to remember to add them to the "perl Makefile.PL" line for future
mod_perl builds.

The thing that clued me into my problem was that CGI.pm is a core module
(which I was reminded of by skimming thru the Programming Perl/camel
book today).  CGI.pm should therefore ALWAYS be available (safe
assumption I suppose), and it wasn't in this case - so I had done
something wrong.  It didn't take long (about 5 seconds) to figure out
WHY is wasn't in the core any longer.  

I've never seen anything warning against doing things this way (root,
UNINST=1 AND PREFIX/LIB) (that I remember at least) so if this is
already well-known and documented, please, make me $humble++, and
enlighten me.  I understand it - now - I'm just hoping it's an "obvious
in hindsight only" type of thing.

Thanks,

Jim

Reply via email to