如何安装多个Perl版本,而又不会使它们互斥于彼此的XS模块? [英] How can Install multiple Perl versions without them tripping over each other's XS modules?

查看:103
本文介绍了如何安装多个Perl版本,而又不会使它们互斥于彼此的XS模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的主目录中安装几个不同版本的perl。我尝试使用 App: :perlbrew ,但是一个版本的XS模块在另一版本中引起了段错误。有什么方法可以安装多个版本的perl,并让它们自动将它们的XS模块分开?

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?

推荐答案

您可以安装每个perl与任何其他Perl安装完全分开。它的二进制文件和模块将完全彼此分开。本质上,当您安装每个perl时,都为其赋予了自己的前缀:

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

所有内容均已安装在该前缀下,并且所有程序在 bin / 中将使用该特定的perl。我在有效的Perl编程中对此进行了更深入的介绍。

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.

从那里,在我的〜/ bin 中建立符号链接。 em>到每个程序,并附加版本号,所以我有〜/ perl5.12.1 perldoc5.12.1 ,依此类推。我不需要选择Perlbrew希望您使用的版本。我在链接到每个版本工具。 Effective Perler 博客中。

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.

您也许可以为此使用local :: lib,但这是真正适合您使用一种版本的Perl并使用一个个人库目录。您可以告诉它使用另一个目录,但是到那时,它真的不能为您节省任何传统方式。

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.

这篇关于如何安装多个Perl版本,而又不会使它们互斥于彼此的XS模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆