升级至Perl-5.36.0

首先下载Perl-5.36.0.tar.gz数据包:

#cd /usr/local/src
......
#wget https://www.cpan.org/src/5.0/perl-5.36.0.tar.gz
......

解压缩数据包:

#tar -xzf perl-5.36.0.tar.gz
......

设置编译环境和选项:

#cd perl-5.36.0
......
#./Configure -des
......

注意:这里使用的是缺省目录项配置。如果对Linux不熟悉,请尽量使用缺省配置。

开始编译和安装:

#make
......
#make install
.....

注意:在缺省状态下,perl会安装至/usr/local/bin目录下。

先建立一个备份目录,将原有的指令移动到备份目录中。

#mkdir /usr/bin/backup
......
#mv /usr/bin/perl /usr/bin/backup/
......

建立软链接:

#ln -s /usr/local/bin/perl /usr/bin/perl
......

检查软链接:

# perl -v

This is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-linux-thread-multi

Copyright 1987-2022, 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 https://www.perl.org/, the Perl Home Page.

此时打印的版本号,应是最新的Perl版本号。