Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a non-global equivalent of perlbrew?

I'm using perlbrew right now to manage multiple versions of perl, but perlbrew is global. If I do perlbrew switch perl-5.10.1 in any shell, then all shells and scripts will now be using perl version 5.10.1. There is no isolation. Is there any way to make perlbrew switches local to a shell, or is there a similar tool capable of locally changing the active perl?

like image 821
Ryan C. Thompson Avatar asked Oct 08 '10 21:10

Ryan C. Thompson


2 Answers

Just don't use perlbrew. All it's doing is changing symlinks for you. It's supposed to save you work, but when it's not, there's no longer a reason to use it.

I talk about how I do it in Make links to per-version tools in The Effective Perler. I always know which perl I'm using because I never have to remember which one I switched to last, and I don't disturb anything else expecting a particular version behind a symlink. You can still use perlbrew to install perls, but it's not saving you that much work there either.

like image 92
brian d foy Avatar answered Nov 08 '22 17:11

brian d foy


In more recent versions of Perlbrew, you can do perlbrew use perl-5.12.3 or whatever and you'll be using that version of Perl, but only in the current shell session. Other sessions won't be affected.

like image 4
Piers Cawley Avatar answered Nov 08 '22 19:11

Piers Cawley