If you haven't tried local::lib yet, you are missing out on one of the most useful bits in the modern Perl tool chain. This is a short blog serving as an early introduction to App::local::lib::helper (currently on github only) which is a helper utility intended to make it easier to use an already installed local::lib managed directory. This basically detects an existing local::lib and installs a helper script to run a command under it. For example, given a local::lib in ~/mylib you can do:
~/mylib/bin/localenv bash
This opens a new bash sub shell with you environment altered so that the lib and bin directories of your local::lib are easily used (added to $PATH and $PERL5LIB, etc.)
More examples to come, but feel free to poke a bit and complain, if you are interested. This code will eventually serve as replacement for bootstrap-local-lib which I have previously blogged about, but which terribly overlaps with functionality already built into tools like cpanminus. Hopefully this new tool will serve a better and more targeted purpose. However if you are using that tool and would like me to maintain it please also feel free to let me know :)
[this is good] I approve muchly of this. I was thinking of hacking together something of similar nature.You may wish to consider the following:1. Per ENV configuration files.2. Ability to choose between inheriting the parent environment ( with regard to things that affect Perl ) or sterilizing the parent environment to be as trimmed back to Perl essentials as possible. 3. Ability to choose from a stack of parent local::lib installs to automatically inherit all their ENV from. ( In a given order )
Posted by: Kent Fredric | 08/05/2010 at 09:59 AM
Others have suggested some sort of manager on top of this that lets you flip on multiple libs. Now that this is on the way to CPAN I'm going to see how it settles out before I tackle that.Oh, you might want to take a lot at: http://search.cpan.org/perldoc?local::lib::profiles which I seriously looked at. It does similar stuff as my App::local::lib::helper but more generic it seems. Take a look that might work better for your need.
Posted by: John Napiorkowski | 08/05/2010 at 01:20 PM