如何安装多个版本的Perl? [英] How should I install more than one version of Perl?

查看:180
本文介绍了如何安装多个版本的Perl?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从源代码安装Perl版本 5.005 v5.6 v5.8 v5.10

I want to install, from source, Perl versions 5.005, v5.6, v5.8, v5.10

现在我有'v5。 10.0安装。

Right now I have 'v5.10.0' installed.


/opt/perl/bin
/opt/perl/html
/opt/perl/lib
/opt/perl/man
/opt/perl/lib/5.10.0
/opt/perl/lib/site_perl
/opt/perl/lib/site_perl/5.10.0






如果我们全部安装在code> / opt / perl ?

或者我应该将它们分成自己的,特定于版本的目录?像 /opt/perl-5.10.0 /

Or should I split them up into their own, version specific, directories? Like /opt/perl-5.10.0/

推荐答案

我安装我所有的perls完全在自己的目录,所以他们不与任何其他perl共享任何东西。要做到这一点,你只需要在配置脚本中安装所有内容。我喜欢 / usr / local / perls

I install all of my perls completely in their own directory so they don't share anything with any other perl. To do that, you just tell the Configure script where to install everything. I like /usr/local/perls:

 % ./Configure -des -Dprefix=/usr/local/perls/perl-5.x.y

当我为多个版本执行此操作时,我得到一个具有单独安装的目录。

When I do that for multiple versions, I get a directory that has separate installations.


% ls -1 /usr/local/perls
perl-5.10.0
perl-5.10.1
perl-5.6.2
perl-5.8.8

他们都有自己的bin和lib目录:

They all have their own bin and lib directories:


% ls -1 /usr/local/perls/perl-5.10.0
bin
lib
man

大多数常用工具会计算出如果您使用不同的perl来调用它们,那么该如何处理:

Most of the common tools will figure out what to do if you call them with different perls:

/usr/local/perls/perl-5.10.0/bin/perl /usr/local/bin/cpan

但是,您可以使用最需要使用的perl,并将其放在路径中。我只是将一个符号链接到/ usr / local / bin / perl,但是您也可以将目录添加到PATH。

However, you can take the perl you want to use the most and put it first in your path. I just make a symlink to /usr/local/bin/perl, but you can add directories to PATH as well.

perlbrew 为您做了很多工作,并移动符号链接,使其中一个默认为perl。

The perlbrew does a lot of this for you and moves symlinks around to make one of them the default perl.

这篇关于如何安装多个版本的Perl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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