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

Hello, I installed a Linux distribution and Perl about 4 or 5 years ago and I haven't touched the configuration since. I plan to install a new distribution soon and in looking over the Perl installation I think I may have problems. I used to install modules into a nonstandard directory, e.g. /Data/Perl and then set the environmental variable PERL5LIB to point to the correct directories. The reason for doing that is that it makes it easier to test a module and determine whether or not to keep or remove it rather install it into the /usr libraries. I did this, if I recall correctly, by using make --prefix=/Data/Perl or something similar. It seems with the recent modules I can't do that. I suppose I could hand edit the Makefile, but I'll probably goof up. So the questions are: 1. Am I correct in assuming that the --prefix= option is gone now? 2. An suggestions on how to install into an unofficial directory and set an environmental variable to point to it? Thanks in advance for your help klee12

Replies are listed 'Best First'.
Re: Configuring Perl
by Corion (Patriarch) on Sep 12, 2007 at 19:01 UTC

    Read the README file that comes with your Perl. On the first screen, there is the magic incantation to use when installing Perl into a separate directory (as everybody should):

    ./Configure -des -Dprefix=/Data/Perl

    For setting up PERL5LIB, everything is still as it ever was, see perlrun for the nitty gritty.

      Thanks for your reply, Corion. Unfortunately I don't seem to have a Configure file. I'm using the system installation of Perl and downloading my own modules. The file README.txt that came with the moudule (MP3-Tag-0.9709) gives the following instructions:
      perl Makefile.PL
      make
      make test
      make install   (as root)
      
      
      Now that I think of it, when I installed modules several years ago, there was a configure step. That seems to be missing now.
      klee12

        Ah. If you are not (re)configuring and reinstalling Perl but only Perl modules, then it's just:

        perl Makefile.PL PREFIX=/Data/Perl make make test make install # as yourself, not as root, as long as you have write per +missions to /Data/Perl
Re: Configuring Perl
by jbert (Priest) on Sep 13, 2007 at 13:56 UTC
    If you use the CPAN module to install modules:
    perl -MCPAN -e shell
    then you can configure some default arguments, so you can have the PREFIX put on automatically. The first time you run the CPAN module it will prompt you for options like this, and PREFIX is one of the examples given in the prompts.

    It's what I do, to install modules in a non-system location for easy housekeeping.