Perl下载页面 https://www.activestate.com/activeperl/downloads 按系统下载
我的Linux系统自带的perl是5.10的;
# perl -v
...
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
...
0
1
2
3
# perl -v
...
Thisisperl,v5.10.1(*)builtforx86_64-linux-thread-multi
...
现在我要装最新版本的5.26
# wget http://downloads.activestate.com/ActivePerl/releases/5.26.0.2600/ActivePerl-5.26.0.2600-x86_64-linux-glibc-2.15-403863.tar.gz
# tar -zxvf ActivePerl-5.26.0.2600-x86_64-linux-glibc-2.15-403863.tar.gz
# cd ./ActivePerl-5.26.0.2600-x86_64-linux-glibc-2.15-403863
# ls
ACTIVEPERL.txt LICENSE.txt RELEASE.txt perl
CHANGES.txt README.txt install.sh support
0
1
2
3
4
5
# wget http://downloads.activestate.com/ActivePerl/releases/5.26.0.2600/ActivePerl-5.26.0.2600-x86_64-linux-glibc-2.15-403863.tar.gz
# tar -zxvf ActivePerl-5.26.0.2600-x86_64-linux-glibc-2.15-403863.tar.gz
# cd ./ActivePerl-5.26.0.2600-x86_64-linux-glibc-2.15-403863
# ls
ACTIVEPERL.txtLICENSE.txtRELEASE.txtperl
CHANGES.txtREADME.txtinstall.shsupport
执行安装文件,如果有报错提示:perl/bin/perl: /lib64/libc.so.6: version `GLIBC_2.14′ not found (required by perl/bin/perl),请看CentOS中安装Perl时出错解决方法
# ./install.sh
Checking package...done
Welcome to ActivePerl
ActivePerl is ActiveState's quality-assured binary build of
Perl. In order to install ActivePerl you need to agree to
the ACTIVESTATE® COMMUNITY EDITION LICENSE AGREEMENT.
Did you read the LICENSE.txt file? [no]
0
1
2
3
4
5
6
7
8
9
# ./install.sh
Checkingpackage...done
WelcometoActivePerl
ActivePerlisActiveState'squality-assuredbinarybuildof
Perl.InordertoinstallActivePerlyouneedtoagreeto
theACTIVESTATE®COMMUNITYEDITIONLICENSEAGREEMENT.
DidyoureadtheLICENSE.txtfile?[no]
上面提示后,输入 y 回车
Do you agree to the ACTIVESTATE® COMMUNITY EDITION LICENSE AGREEMENT? [no]
0
DoyouagreetotheACTIVESTATE®COMMUNITYEDITIONLICENSEAGREEMENT?[no]
上面提示后,输入 y 回车
This installer can install ActivePerl in any location of your
choice. You do not need root privileges. However, please make sure
that you have write access to this location.
Enter top level directory for install? [/opt/ActivePerl-5.26]
0
1
2
3
4
ThisinstallercaninstallActivePerlinanylocationofyour
choice.Youdonotneedrootprivileges.However,pleasemakesure
thatyouhavewriteaccesstothislocation.
Entertopleveldirectoryforinstall?[/opt/ActivePerl-5.26]
上面提示后,输入绝对路径的安装目录 /opt/ActivePerl-5.26 回车
The ActivePerl documentation is available in HTML format. If installed
it will be available from file:///opt/ActivePerl-5.26/html/index.html.
If not installed you will still be able to read all the basic perl and
module documentation using the man or perldoc utilities.
Install HTML documentation [yes]
0
1
2
3
4
5
TheActivePerldocumentationisavailableinHTMLformat.Ifinstalled
itwillbeavailablefromfile:///opt/ActivePerl-5.26/html/index.html.
Ifnotinstalledyouwillstillbeabletoreadallthebasicperland
moduledocumentationusingthemanorperldocutilities.
InstallHTMLdocumentation[yes]
上面提示后,输入 y 回车
Ok.
The typical ActivePerl software installation requires 200 megabytes.
Please make sure enough free space is available before continuing.
Proceed? [yes]
0
1
2
3
4
5
Ok.
ThetypicalActivePerlsoftwareinstallationrequires200megabytes.
Pleasemakesureenoughfreespaceisavailablebeforecontinuing.
Proceed?[yes]
上面提示后,输入 y 回车
Ok.
Installing ActivePerl...
Copying files to /opt/ActivePerl-5.26...done
Relocating...done (280 files relocated)
Generating HTML documentation...done
Syncing perl PPM database with .packlists...done
ActivePerl has been successfully installed at /opt/ActivePerl-5.26.
Please modify your startup environment by adding:
/opt/ActivePerl-5.26/site/bin:/opt/ActivePerl-5.26/bin to PATH
/opt/ActivePerl-5.26/site/man:/opt/ActivePerl-5.26/man to MANPATH
For general questions or comments about ActivePerl, please
contact us at .
Thank you for using ActivePerl!
Do you want to download a free trial of Komodo IDE? [Y/n]
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Ok.
InstallingActivePerl...
Copyingfilesto/opt/ActivePerl-5.26...done
Relocating...done(280filesrelocated)
GeneratingHTMLdocumentation...done
SyncingperlPPMdatabasewith.packlists...done
ActivePerlhasbeensuccessfullyinstalledat/opt/ActivePerl-5.26.
Pleasemodifyyourstartupenvironmentbyadding:
/opt/ActivePerl-5.26/site/bin:/opt/ActivePerl-5.26/bintoPATH
/opt/ActivePerl-5.26/site/man:/opt/ActivePerl-5.26/mantoMANPATH
ForgeneralquestionsorcommentsaboutActivePerl,please
contactusat.
ThankyouforusingActivePerl!
DoyouwanttodownloadafreetrialofKomodoIDE?[Y/n]
上面提示后,这是要安装一个集成开发工具,想装就输入y,不装就输入 n 回车,安装结束。
创建软连接,就相当于是windows中的快捷方式图标一样
# ln -s /opt/ActivePerl-5.26/perl /usr/bin/perl5.26.0
# cd /usr/bin
# ln -s perl5.26.0 perl
0
1
2
# ln -s /opt/ActivePerl-5.26/perl /usr/bin/perl5.26.0
# cd /usr/bin
# ln -s perl5.26.0 perl
查看版本,显示出版本号,但是有警告
# perl -v
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "zh_CN.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
This is perl 5, version 26, subversion 0 (v5.26.0) built for x86_64-linux-thread -multi
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2017, Larry Wall
Binary build 2600 [403863] provided by ActiveState http://www.ActiveState.com
Built Aug 24 2017 21:59:59
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.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# perl -v
perl:warning:Settinglocalefailed.
perl:warning:Pleasecheckthatyourlocalesettings:
LANGUAGE=(unset),
LC_ALL=(unset),
LANG="zh_CN.UTF-8"
aresupportedandinstalledonyoursystem.
perl:warning:Fallingbacktothestandardlocale("C").
Thisisperl5,version26,subversion0(v5.26.0)builtforx86_64-linux-thread-multi
(with1registeredpatch,seeperl-Vformoredetail)
Copyright1987-2017,LarryWall
Binarybuild2600[403863]providedbyActiveStatehttp://www.ActiveState.com
BuiltAug24201721:59:59
PerlmaybecopiedonlyunderthetermsofeithertheArtisticLicenseorthe
GNUGeneralPublicLicense,whichmaybefoundinthePerl5sourcekit.
CompletedocumentationforPerl,includingFAQlists,shouldbefoundon
thissystemusing"man perl"or"perldoc perl".Ifyouhaveaccesstothe
Internet,pointyourbrowserathttp://www.perl.org/,thePerlHomePage.
查看locale
# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# locale
locale:CannotsetLC_CTYPEtodefaultlocale:Nosuchfileordirectory
locale:CannotsetLC_MESSAGEStodefaultlocale:Nosuchfileordirectory
locale:CannotsetLC_ALLtodefaultlocale:Nosuchfileordirectory
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
这三项需要设置LANGUAGE、LC_ALL、LANG,方法如下:
# cd /root
# vi .bachrc
0
1
# cd /root
# vi .bachrc
在最末尾另起一行输入下面三行代码
export LANG=en_US:zh_CN.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=C
0
1
2
exportLANG=en_US:zh_CN.UTF-8
exportLANGUAGE=en_US.UTF-8
exportLC_ALL=C
保存并退出编辑
# source .bashrc
# perl -e exit
# perl -v
# locale
LANG=en_US:zh_CN.UTF-8
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# source .bashrc
# perl -e exit
# perl -v
# locale
LANG=en_US:zh_CN.UTF-8
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C
没有警告,可以快乐地使用perl了。