LoginSignup
8
8

More than 5 years have passed since last update.

perlbrewとcpanmでPerl環境を作る

Posted at

普段使っていないのですぐに忘れてしまう。いい加減メモしておく。シェルはzshを使っている。

まずはperlbrewを入れる。

$ curl -kL http://xrl.us/perlbrewinstall | bash
$ rehash
$ perlbrew init

.zshenvはこんな感じにしておく。

.zshenv
if [ -d "$HOME/perl5/perlbrew" ]; then
  source $HOME/perl5/perlbrew/etc/bashrc
fi

使いたいPerlのバージョンを指定してインストール、この時GREP_OPTION環境変数が悪さをしてコンパイルがこけるので、GREP_OPTIONを消す

$ GREP_OPTIONS= perlbrew install perl-5.14.2

おわったらswitch

$ perlbrew switch 5.14.2

確認

$ which perl
/home/hagino3000/perl5/perlbrew/perls/perl-5.14.2/bin/perl
$ perl -v
This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux

cpanmのインストール

curl -L http://cpanmin.us/ | perl - App::cpanminus

以降はcpanmを使ってパッケージを入れる。

8
8
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
8
8