如何将外部管理的 Perl 安装添加到 Perlbrew?

发布于 2024-09-28 04:57:11 字数 317 浏览 5 评论 0原文

我想使用 perlbrew 来管理我系统上的多个 Perl 安装。

然而,除了从 CPAN 进行的全新安装和系统安装之外,我还有一些与特定项目相关的其他 Perl 安装。我也希望能够切换到这些 perls。

例如,如果我有 /opt/SomeApp/perl/bin/perl 以及 /opt/SomeApp/perl/lib 中的库,如何将其添加到 perlbrew?

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?

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

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

发布评论

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

评论(2

弥繁 2024-10-05 04:57:11

Perlbrew 确实允许您切换到任何可以使用的 Perl在PATH环境变量中查找。例如:

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

您现在应该看到 /opt/SomeApp/perl/bin/perl 列为 perlbrew 管理的 perl。所以现在(在同一个 shell 会话中)你可以这样做:

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

注意。您可能会发现 perlbrew switch ... 无需修改 $PATH 即可工作。

/I3az/

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/

離人涙 2024-10-05 04:57:11

perlbrew 在 PERLBREW 环境变量下查找它的 perls,但它也期望在那里找到的不仅仅是你的 perls。它还管理一些状态并创建一些目录来保存最新的符号链接。

当您在 perlbrew 目录中创建符号链接使其看起来像 /opt/SomeApp/perl/bin/perl~/perl5/perlbrew/perl/SomeApp 时,会发生什么?

不过,我仍然认为这会导致混乱和灾难。任何需要特定安装的东西都不应该依赖于可变链接。

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.

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