develooper Front page | perl.qa | Postings from April 2011

Re: Using CPAN or CPANPLUS to install a list of modules (even ifalready installed) into a specified location

Thread Previous | Thread Next
From:
Paul Johnson
Date:
April 28, 2011 14:55
Subject:
Re: Using CPAN or CPANPLUS to install a list of modules (even ifalready installed) into a specified location
Message ID:
20110428215512.GL3150@pjcj.net
On Thu, Apr 28, 2011 at 02:00:52PM -0700, Matisse Enzer wrote:
> Is there an existing way to do the equivalent of:
> 
> 
> 	cpanp --prefix=/tmp/MyCollection --ignore-already-installed Module::One Module::Two ...
> 
> The idea being that even if Module::One is already installed somewhere in @INC that i still end up with something like this:
> 
>   /tmp/MyCollection/lib/perl/5.10.0/Module/One.pm
>   /tmp/MyCollection/lib/perl/5.10.0/Module/Two.pm

I would imagine that this could be done by writing a short module to put
a subroutine in @INC to check for the specific modules you you are
concerned with.  Unfortunately I don't think there's a way to signal
that the remaining parts of @INC should be ignored, so I think you'd
need to clean out the rest of @INC and perform the search for the other
modules in your subroutine.

I suspect that an update to the API for this situation might be
welcomed.

-- 
Paul Johnson - paul@pjcj.net
http://www.pjcj.net

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About