[Wellington-pm] CPAN to project lib directory

Ewen McNeill perl at ewen.mcneill.gen.nz
Mon Apr 5 20:51:30 PDT 2010


Lenz Gschwendtner wrote:
> have a look at cpanminus and hack it to your likings 
> and then make this new one a project dependency ... 

That wasn't quite the answer I was looking for :-)  But cpanminus does 
look somewhat interesting, and I wasn't aware of it before so thanks for 
the pointer.

FTR, what I ended up doing was this ugly kludge:

mkdir lib/CPAN
cpan
! my $pwd=`pwd`; chomp $pwd; $CPAN::Config->{makepl_arg} = 
"INSTALL_BASE=$pwd/lib/CPAN";
! my $pwd=`pwd`; chomp $pwd; $CPAN::Config->{mbuild__arg} = 
"--install_base $pwd/lib/CPAN";

(each "!" command on a single line, not word wrapped.)

Assuming that you run it from the top level of your project directory.

(One could, perhaps, wrap expect around "cpan" to do this based on
a project directory set of settings, but that's at least as baroque.)

Ewen


More information about the Wellington-pm mailing list