in reply to path to perl on umbuntu

First of all:   Do not feel alone in this!   I am extremely sympathetic to your plight, and I can point to several damaged walls (and slightly-bent books and desktop objects that still won’t speak to me) to prove it.

Next:   Be prepared for “a sip from the firehose.”   These things, too, shall pass.   It will all make sense.   It will not do so right away.   It will seem that it never could.

Next, a few random thoughts:

  1. If Perl is installed on the computer now, you probably do not need to install another version.   But in addition, you do not want to disturb the installation that is there, if (say...) any Umbuntu system management software might depend on it.   If that Perl installation is being maintained using packages, vs. CPAN, you probably do not want to disturb it.   This is possible.
  2. You need to “Google” for more information about how CPAN works, and “how to set up Perl as a non-root user.”
  3. Type perl -V ... note the capital “V” ... and ponder the results.   Particularly the last bit ... a little variable called @INC.   (Mind you, I am not being “coy.”   As you read what I have asked you to read, it will all come clear.)

Perl refers to various environmental settings, such as the variable PERL5LIB.   CPAN, likewise, uses settings which it stores in a hidden file.   It is therefore possible to set up your own, local, “Perl library,” managing it by CPAN and doing so without disturbing what Umbuntu may be doing.   The situation is exactly like the one faced by a person who is setting up Perl for use on a website in a shared-hosting ISP:   this is a computer that the various website owners do not own, and each website (there might be hundreds on the same box) can have its own peculiar Perl configuration apart from all the others.   And that is why I have pointed you specifically to such documents.

Replies are listed 'Best First'.
Re^2: path to perl on umbuntu
by Anonymous Monk on Oct 27, 2010 at 17:54 UTC
    Hi

    I understand that I can use the Perl5LIB env variable to modify the @INC files. That was what I was going to do in the first place before this thread advised me to leave the sysytem perl alone :)

    On that issue My problem is more with Linux and CPAN than Perl. I have looked into how CPAN works but I don't know how I configure CPAN to install modules to a specific location. Also when I get modules I want, they will have dependencies on other modules and CPAN might get new versions of these modules. I don't know if this will have bad affects on any system perl that depends on these 'updated' modules.

    Many thanks for your help

      You might find some helpful guidance in Yes, even you can use CPAN Installing Modules Without Root.

      If your personal library appears before the system libraries in the @INC variable (the list of directories perl searches for modules) then perl will find the modules you have installed and use them instead of whatever version is in the system libraries. You may have issues with dependencies but you can install as much as you want/need to in your personal library to satisfy those dependencies. This will work until you need perl itself to be different (e.g. different compile time options). But this isn't likely to be a problem in the short term.