Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello,
I have a set of modules that i had developed and installed locally using the PREFIX= option.
perl Makefile.PL PREFIX=/mylocal/path
make;make test;make install
It had installed all the modules under
/mylocal/path/lib/perl5/site_perl/5.10.0

The other day I had to make modification to one of the modules. So I did, and then executed
perl Makefile.PL PREFIX=/mylocal/path
make;make test;make install

Well I was hoping that the originally installed module under /mylocal/path/lib/perl5/site_perl/5.10.0 would get replaced.
However what i noticed is it installed a complete new copy under /mylocal/path/share/perl5

I had built the module directory structure using h2xs.
I am assuming when I initially installed the modules, probably the perl version was 5.10.0 Currently the perl version is v5.10.1 (probably the sysadmin upgraded the system or something).

Question
1) What did i do wrong? and
2) How can I fix this such that any changes and re-install to an existing module will over-write the original one instead of creating a new copy under the share directory.

Thanks
  • Comment on Question on installing modules in local dir using PREFIX

Replies are listed 'Best First'.
Re: Question on installing modules in local dir using PREFIX
by syphilis (Archbishop) on Sep 23, 2010 at 22:35 UTC
    The precise location determined by PREFIX depends upon perl's configuration. Perhaps the new perl has been configured slightly differently, and it's that difference that accounts for the change to PREFIX.

    Best way to avoid problems like this is to:
    perl Makefile.PL INSTALL_BASE=/mylocal/path
    I don't know whether that will put modules in the same place as the old PREFIX did, but it will not be dependent upon perl's configuration, and will remain the same from one build of perl to the next.

    For further info, see the ExtUtils::MakeMaker documentation. (See the "INSTALL_BASE" and "PREFIX and LIB attribute" sections.)

    Cheers,
    Rob
      Thank you so much.
      I read the ExtUtils::MakeMaker documentation and looks like
      I should have been using INSTALL_BASE all along instead of PREFIX for what I was doing.
      Thank you again.
Re: Question on installing modules in local dir using PREFIX
by SilasTheMonk (Chaplain) on Sep 23, 2010 at 20:13 UTC
      Hello,
      Thank you for the response. Here are the contents of Makefile.PL
      use 5.010000; use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => 'XXXAUTO::PROVISION::Command', VERSION_FROM => 'lib/XXXAUTO/PROVISION/Command.pm', # finds $ +VERSION PREREQ_PM => {}, # e.g., Module::Name => 1.1 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'lib/XXXAUTO/PROVISION/Command.pm', # retriev +e abstract from module AUTHOR => 'XXX Auto Grp <auto@localdomain>') : ()), );