如何安装多个 Perl 版本而不被彼此的 XS 模块绊倒?

发布于 2024-09-14 13:16:01 字数 260 浏览 2 评论 0原文

我想在我的主目录中安装几个不同版本的 perl。我尝试使用 App::perlbrew< /code>,但一个版本中的 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海风掠过北极光 2024-09-21 13:16:01

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

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

所有内容都安装在该前缀下,并且 bin/ 中的所有程序都将使用该特定的 perl。我在有效的 Perl 编程中更深入地讨论了这个问题。

从那里,我在我的 ~/bin 中为每个程序创建符号链接,并将版本号附加到它,所以我有 ~/perl5.12.1 perldoc5.12.1,等等。我不必按照 perlbrew 想要的方式选择版本。我在 Make links to per- 中写了更多相关内容版本工具。Effective Perler 博客中。

您也许可以使用 local::lib 来实现此目的,但它实际上是为您使用一种版本的 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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文