CPAN install nightmare

Dave Evans mkpm-20051014 at
Mon Mar 27 12:52:18 PST 2006

On Mon, Mar 27, 2006 at 09:27:01PM +0100, Ian Cameron wrote:
> Hello,


Easy questions first.

> How is the location of installed modules decided?

Each installation of Perl has a whole bunch of "Config" values (which were
chosen when perl was built), including things such as where to install
modules, where to install `bin' or `sbin' files, etc.  For example, try typing
`perl -V:sitearch' to see where (IIRC) CPAN will tend to install modules.

> How does Perl know where to look for them?

Each `perl' executable has a compiled-in default search path.  Type
`/path/to/perl -V' to see the default list.

> Can modules installed under each setup be used together, and if so how?

Sometimes (in fact, usually).  However, it's not usually a good idea.
You would do this by adding the extra directories to the lib search path, e.g.
using `perl -I ...' or `use lib ...'.

> The new perl is the one in /usr/local/bin, which is 5.8.8, the one in
> /usr/bin is 5.8.5 and came via the RHEL RPM's.  I presume the 5.8.8 version
> was installed to satisfy a dependency when I installed one of the other
> modules.

Sounds convincing.  Sometimes a module will decide that it requires a
whole new version of Perl, so CPAN will "helpfully" download and install a new
Perl for you.  And no, I've never found this to be a useful behaviour. :-(

Personally what I would do now is disregard the new perl (i.e. the one under
/usr/local), and try installing the modules you require using the packaged
perl.   Beware: when you start CPAN (e.g. by typing 'cpan', or 'perl -MCPAN -eshell'),
make sure you type the full path to the correct perl / cpan.

For example,
 "/usr/bin/perl -MCPAN -eshell"
will install things under your RPM'd perl, whereas
 "/usr/local/bin/perl -MCPAN -eshell"
whill install things for your new /usr/local perl; whereas the behaviour of
 "perl -MCPAN -eshell"
depends on which `perl` is in your $PATH first.

Did that make sense?

Dave Evans

PGP key:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url :

More information about the MiltonKeynes-pm mailing list