如何指定在CentOS上使用哪个版本的Perl [英] How to specify which version of perl to use on CentOS

查看:454
本文介绍了如何指定在CentOS上使用哪个版本的Perl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行CentOS 5.4,默认情况下只有Perl 5.8版,并且我有一个需要Perl 5.10的程序,因此我在CentOS上编译了Perl 5.10.如何指定要与哪个Perl一起运行程序,因为perl命令默认情况下使用5.8.

I am running CentOS 5.4 which only has version 5.8 of perl available by default, and I have a program which requires perl 5.10, so I compiled perl 5.10 on CentOS. How do I specify which perl I want to run the program with because the perl command uses 5.8 by default.

推荐答案

我的声音是建议完全避免干扰系统perl.

I add my voice to recommending against messing with the system perl at all.

还没有人提到 App :: perlbrew .它使您可以拥有多个版本的Perl并在它们之间轻松切换.当然,这可以手动完成,但是使用此工具为您轻松得多.来自Pod –

No one mentioned App::perlbrew yet. It allows you to have several versions of Perl and switch between them easily. This can be done manually of course but it's much easier to have this tool to do it for you; from the Pod–

# Install some Perls
perlbrew install perl-5.12.2
perlbrew install perl-5.8.1
perlbrew install perl-5.13.6

# See what were installed
perlbrew list

# Switch perl in the $PATH
perlbrew switch perl-5.12.2
perl -v

# Switch to another version
perlbrew switch perl-5.8.1
perl -v

# Switch to a certain perl executable not managed by perlbrew.
perlbrew switch /usr/bin/perl

# Or turn it off completely. Useful when you messed up too deep.
perlbrew off

# Use 'switch' command to turn it back on.
perlbrew switch perl-5.12.2

这篇关于如何指定在CentOS上使用哪个版本的Perl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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