CentOS 8.5にPerl 5.26 をインストールする

環境
# cat /etc/redhat-release
CentOS Linux release 8.5.2111

インストールの方法
1.Perlのバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf module list perl
CentOS Linux 8 - AppStream
Name Stream Profiles Summary
perl 5.24 common [d], minimal Practical Extraction and Report Language
perl 5.26 [d][e] common [d], minimal Practical Extraction and Report Language
perl 5.30 common [d], minimal Practical Extraction and Report Language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
# dnf module list perl CentOS Linux 8 - AppStream Name Stream Profiles Summary perl 5.24 common [d], minimal Practical Extraction and Report Language perl 5.26 [d][e] common [d], minimal Practical Extraction and Report Language perl 5.30 common [d], minimal Practical Extraction and Report Language Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
# dnf module list perl
CentOS Linux 8 - AppStream
Name                 Stream                     Profiles                           Summary
perl                 5.24                       common [d], minimal                Practical Extraction and Report Language
perl                 5.26 [d][e]                common [d], minimal                Practical Extraction and Report Language
perl                 5.30                       common [d], minimal                Practical Extraction and Report Language

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

2.perl 5.26 を指定してインストールします
# dnf module -y install perl:5.26

3.perlバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# perl -V:version
version='5.26.3';
# perl -V:version version='5.26.3';
# perl -V:version
version='5.26.3';

4.テストプログラムを作成します
# vi test.pl
下記の内容を追記します
print “study perl become smart version 5.26";

ファイルを実行します
# perl test.pl
study perl become smart version 5.26

CentOS8

Posted by arkgame