in reply to Very confused about system perl and local perl
If you use 'sudo apt-get install', then the modules get installed by the 'root' user into the system perl area - which is what you want to do if you have multiple users on the machine and they ALL want access to those perl modules.
If you run cpan using the system perl, you can control where cpan puts the modules. By default, it will put stuff under /usr/lib/perl5/site_perl. The modules that come with the system perl are also under /usr/lib/perl5, but not in site_perl. So you should actually be okay doing it this way. To be safe, you can configure cpan to put things into a different localtion, like "~/lib". Then you have to add a line like "use lib 'path/to/my/lib';" in all your scripts, so it can find your modules.
The advantage of using apt-get is that the package manager takes care of installing anything else that a module might depend on, and it knows if something gets updated, etc. But the package manager usually does not have the latest greatest versions of every module, and some modules are not in the package manager at all, so a little bit of mix-n-match is probably unavoidable. I personally tend to you apt-get for modules that require external c libraries. It's possible to download/compile/install things like this in your 'home' directory, but it can be a real pain. For pure-perl modules, cpan usually works great.
The most important step, I think, is that you first make good backups. Just use something like tar&split to backup your entire system to an external USB drive before installing something. That way, if something breaks, you can simply revert back to what you had.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Very confused about system perl and local perl
by Anonymous Monk on Oct 28, 2010 at 16:04 UTC | |
by ikegami (Patriarch) on Oct 28, 2010 at 19:06 UTC | |
by jethro (Monsignor) on Oct 28, 2010 at 16:50 UTC | |
by scorpio17 (Canon) on Oct 29, 2010 at 14:13 UTC | |
by Anonymous Monk on Oct 29, 2010 at 15:33 UTC | |
by Anonymous Monk on Oct 28, 2010 at 18:16 UTC |