[Catalyst] How to use local::lib

Tomas Doran bobtfish at bobtfish.net
Mon Jun 22 17:04:11 GMT 2009

On 22 Jun 2009, at 16:43, Tobias Kremer wrote:

> After reading about local::lib and thinking that it's too good to be
> true, I just had to try it out as a possible deployment method for one
> of our apps. I have the app and all dependencies running on my
> development box. The prerequisites are specified in my app's
> Makefile.PL. Now, after having bootstrapped local::lib, I ran the
> following commands - as suggested by t0m in a recent thread - but
> nothing happens because all required modules are already installed in
> my system-wide CPAN directory in their correct versions:

Yeah, unfortunately, this doesn't work so good unless your  
dependencies have been installed in a local::lib themselves, and you  
can remove this from PERL5LIB

After rambling about 'just do it like this', I then wandered off and  
tried to make the new --self-contained feature of this work. Wasn't  
quite as easy to make it work generically than I'd implied I don't  

> $ eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=--self- 
> contained,local_lib)
> $ make installdeps
> Am I missing something here or do I really have to checkout my app on
> a fresh installation with no prerequisites installed and try the above
> there?

Yeah, pretty much at the moment. If you install all your  
prerequisites in a local::lib, then if you blank PERL5LIB, then it  
_just works_.

However have a look at:


This is what I threw together after making that posting, and whilst  
it's not quite all there yet - it will at least install a self  
contained Catalyst & etc.

> Also, am I right that this method won't work for XS-based modules if
> I'm building my local_lib, say on a Ubuntu system, while the
> production system is Debian-based?

Correct. You'll have to build your local::lib on a system with  
similar architecture to your production boxen.


More information about the Catalyst mailing list