tags:

views:

41

answers:

2

I would like to use perlbrew to manage multiple Perl installations on my system.

However, in addition to the clean installs from CPAN and the system install, I have a couple of other Perl installs that are tied to specific projects. I would like to be able to switch to these perls as well.

For example, if I have /opt/SomeApp/perl/bin/perl with libraries in /opt/SomeApp/perl/lib, how do I add it to perlbrew?

+1  A: 

perlbrew looks for its perls under the PERLBREW environment variable, but it's also expecting to find more than just your perls under there. It's also managing some state and creating some directories to hold the latest symlinks.

What happens when you make symlinks in your perlbrew directory so it looks like /opt/SomeApp/perl/bin/perl is ~/perl5/perlbrew/perl/SomeApp?

I still think this is a recipe for confusion and disaster, though. Anything that needs a specific installation shouldn't rely on a mutable link.

brian d foy
I'll give your suggestion a try and report back. I agree with you that this would be **madness** in a production environment. I am looking for a way to manage switching between perls for development and testing purposes only.
daotoad
I develop and test without switching.
brian d foy
Maybe it is a bit of an AB problem. Just been looking at your answer here. http://stackoverflow.com/questions/398221/how-do-you-manage-perl-modules-when-using-a-package-manager/398397#398397
daotoad
+1  A: 

Perlbrew does allow you to switch to any Perl it can find in the PATH environment variable. For eg:

export PATH="$PATH:/opt/SomeApp/perl/bin"
perlbrew installed

You should now see /opt/SomeApp/perl/bin/perl listed as a perl that perlbrew manages. So now (in the same shell session) you could do:

perlbrew switch /opt/SomeApp/perl/bin/perl

NB. You will probably find that the perlbrew switch ... works without having to amend $PATH.

/I3az/

draegtun