微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

CentOS下编译安装perl(5.16.1)


首先下载最新的perl源码包:

[root@akinlau /]# wget http://www.cpan.org/src/5.0/perl-5.16.1.tar.gz

解压源码包
[root@akinlau /]# tar -xzf perl-5.16.1.tar.gz

编译并安装,目录可以自定义

[root@akinlau /]# cd perl-5.16.1
[root@akinlau perl-5.16.1]#./Configure -des -Dprefix=/usr/local/perl

[root@akinlau perl-5.16.1]# make
[root@akinlau perl-5.16.1]# make test
[root@akinlau perl-5.16.1]# make install

如果系统以前已安装了旧版本的perl的话,替换系统原有的版本。
[root@akinlau perl-5.16.1]# mv /usr/bin/perl /usr/bin/perl.bak
[root@akinlau perl-5.16.1]# ln -s /usr/local/perl/bin/perl /usr/bin/perl

再看看是不是最新的版本

[root@akinlau perl-5.16.1]# perl -v

This is perl 5,version 16,subversion 1 (v5.16.1) built for x86_64-linux

copyright 1987-2012,Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License,which may be found in the Perl 5 source kit.

Complete documentation for Perl,including FAQ lists,should be found on
this system using “man perl” or “perldoc perl”. If you have access to the
Internet,point your browser at http://www.perl.org/,the Perl Home Page.

如果看到以上信息,就证明安装成功了。

原文地址:https://www.jb51.cc/centos/378194.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。