[Wellington-pm] CPAN to project lib directory

Ewen McNeill perl at ewen.mcneill.gen.nz
Mon Apr 5 19:22:46 PDT 2010


Out of interest has anyone found a way to make the "cpan" command (or 
"perl -MCPAN -e shell") accept project-specific arguments?  The use case 
is that I want to create a library directory for a given project 
(relative to the project base) which contains some additional modules 
from CPAN, which I want to version with the project.  "cpan" has the 
facility to install into a specified base directory, which seems ideal.

Unfortunately the _configuration_ of that in "cpan" appears to be a 
per-user parameter, from a file stored in the user home directory, which 
makes for poor usability (either every user has to save the 
configuration settings when working on the project and remember to 
switch them next time they're working on something else.  Rather than 
having something specified in the project directory itself.

(In an ideal world -- eg, last time I designed a feature like this -- 
one would look in the project for per-project configuration, in the user 
directory for per-user configuration, and then for system-wide 
configuration, in that order.  But I can't see how to make "cpan" do that.)

Ewen


More information about the Wellington-pm mailing list