LoginSignup
4
3

More than 5 years have passed since last update.

perlbrewで構築するPerl環境

Posted at

perlbrewとは

perlbrewは複数のPerlのバージョンをインストールして切り替えしてくれるツールです。

perlbrewのインストール

$ sudo apt-get install perlbrew

perlbrewの初期化

$ perlbrew init


perlbrew root (~/perl5/perlbrew) is initialized.

Append the following piece of code to the end of your ~/.bash_profile and start a
new shell, perlbrew should be up and fully functional from there:

    source ~/perl5/perlbrew/etc/bashrc

Simply run `perlbrew` for usage details.

Happy brewing!

現在のインストールできるバージョンの確認

$ perlbrew available


  perl-5.21.10
  perl-5.20.2
  perl-5.18.4
  perl-5.16.3
  perl-5.14.4
  perl-5.12.5
  perl-5.10.1
  perl-5.8.9
  perl-5.6.2
  perl5.005_04
  perl5.004_05
  perl5.003_07

インストールをする

$ perlbrew install perl-5.21.10

testをスキップすると少し早く終わります。

$ perlbrew install --notest perl-5.21.10


Fetching perl 5.21.10 as /home/suesan/perl5/perlbrew/dists/perl-5.21.10.tar.bz2
Download http://www.cpan.org/src/5.0/perl-5.21.10.tar.bz2 to /home/suesan/perl5/perlbrew/dists/perl-5.21.10.tar.bz2
Installing /home/suesan/perl5/perlbrew/build/perl-5.21.10 into ~/perl5/perlbrew/perls/perl-5.21.10

This could take a while. You can run the following command on another shell to track the status:

  tail -f ~/perl5/perlbrew/build.perl-5.21.10.log

Installation process failed. To spot any issues, check

  /home/suesan/perl5/perlbrew/build.perl-5.21.10.log

If some perl tests failed and you still want install this distribution anyway,
do:

  (cd /home/suesan/perl5/perlbrew/build/perl-5.21.10; make install)

You might also want to try upgrading patchperl before trying again:

  perlbrew install-patchperl

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

  perlbrew --notest install perl-5.21.10
  perlbrew --force install perl-5.21.10

怒られてしまったので、patchperlをインストールする

$ perlbrew install-patchperl

再度、perl-5.21.10をインストールする

$ perlbrew install --notest perl-5.21.10

次のコマンド切り替え可能なバージョンのリストが表示される

$ perlbrew list
perl-5.21.10

切り替えを実行

$ perlbrew switch 5.21.10

もう一度listを見るとアスタリスクがつきます。
これが現在のバージョンです。

$ perlbrew list
* perl-5.21.10

試しにバージョンを確認する

$ perl -v
This is perl 5, version 21, subversion 10 (v5.21.10) built for darwin-2level

おわり

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3