How can Install multiple Perl versions without them tripping over each other's XS modules?
Asked Answered
U

1

6

I would like to install several different versions of perl in my home directory. I tried using App::perlbrew, but XS modules from one version were causing segfaults in the other version. Is there any way to install multiple versions of perl and have them automatically keep their XS modules separate?

Urease answered 15/8, 2010 at 8:9 Comment(3)
Actually, I just remembered that I'm also using local::lib. Maybe they don't interact well. I will try disabling it.Urease
Hmm, it looks like local::lib and perlbrew don't play nice together. This seems to be my problem.Urease
possible duplicate of How do YOU manage Perl modules when using a package manager?Mew
R
11

You can install each perl completely separate from any other perl installation. It's binaries and modules will be completely separate from each other. Essentially, when you install each perl you give it its own prefix:

 $ ./Configure -des -Dprefix=/usr/local/perls/perl-5.12.1

Everything is installed under that prefix, and all of the programs in the bin/ will use that particular perl. I go into this in more depth in Effective Perl Programming.

From there, I make symlinks in my ~/bin to each of those programs and attach the version number to it, so I have ~/perl5.12.1, perldoc5.12.1, and so on. I don't ever have to choose to have a version in the way that perlbrew wants you to. I write more about this in Make links to per-version tools. in the Effective Perler blog.

You might be able to use local::lib for this, but it's really designed for you to work with one version of Perl and use one personal library directory. You can tell it to use another directory, but at that point it's really not saving you anything over the traditional way.

Reverend answered 15/8, 2010 at 8:36 Comment(4)
Thanks for clarifying that local::lib is for a single version only. I have disabled local::lib and perlbrew seems to be doing just fine on its own.Urease
I think -Dprefix might not be enough; I ended up with one perl installation that put all its libs in the right place, but still used /usr/local/bin for executables. I haven't yet gone back to see what happened, so I just mention this as a footnote warning folks to be careful what configurations are generated via -es.Mew
So, is there a way for local::lib to work correctly with multiple perl versions and XS modules, or should I disable it and just let perlbrew handle everything?Urease
Well, I don't use either local::lib or perlbrew. So, that's my opinion. :)Reverend

© 2022 - 2024 — McMap. All rights reserved.