デフォルトのPerlのバージョンが

$ perl -v

This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-mult

で、これを5.26.xまで下げてくれという要望あり。Google先生に聞いたら、やはり先人はいるもので早速教えにしたがって作業開始。

まずはツールをインストール

$ sudo apt install perlbrew

続いて、初期化。ここでは sudo 無し。この次のコマンドも同じ。

$ perlbrew init

希望のバージョンをインストール

$ perlbrew install perl-5.26.3

時間がかかりますぅ..................で、エラーになった(涙)

Generally, if you need to install a perl distribution known to have minor test
failures, do one of these commands to avoid seeing this message:

  perlbrew --notest install perl-5.26.3
  perlbrew --force install perl-5.26.3

ということなので、Notestで実行

$ perlbrew --notest install perl-5.26.3

でできた。確認。

$ perlbrew list
  perl-5.26.3

切り替え!

$ perlbrew switch perl-5.26.3

A sub-shell is launched with perl-5.26.3 as the activated perl. Run 'exit' to finish it.

確認!

$ perl -v

This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2018, 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.


できました^^; ただし、 perlbrew switch で切り替えて使うものでした。なのでapacheなどで使用するバージョンまで切り替えるには、もう一苦労必要です。