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

環境
# 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.30 を指定してインストールします
# dnf module -y install perl:5.30

3.perlバージョンを確認します
# perl -V:version
version=’5.30.1′;

4.テストプログラムを作成します
# vi test.pl
下記の内容を追記します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
print "study perl become smart version 5.30";
print "study perl become smart version 5.30";
print "study perl become smart version 5.30";

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

CentOS8

Posted by arkgame