たごもりすメモ

コードとかその他の話とか。

use latest cpanm -Lextlib with perl v5.8.8 or earlier

'cpanm -Lextlib' requires Module::CoreList, but Module::CoreList was first released with perl v5.8.9. So we should install Module::CoreList at first.

Do as below (be careful with -l and -I (el and ai)):

curl -s -L http://cpanmin.us/ | /usr/bin/perl -- - -l/tmp/module-corelist Module::CoreList
curl -s -L http://cpanmin.us/ | /usr/bin/perl -I/tmp/module-corelist/lib/perl5 -- - -Lextlib Module::CoreList App::cpanminus Carton

# add extlib/bin to PATH for cpanm command
current=$(pwd)
export PATH=$current/extlib/bin:$PATH

# and use carton with PERL5OPT
export PERL5OPT=-Iextlib/lib/perl5

extlib/bin/carton install
日本語で

system perl で cpanm とか carton とか使おうと思うケースがまだ稀にありますが最新の cpanm を -Lextlib オプションつきで使おうとすると Module::CoreList を要求します。が、このモジュールは perl v5.8.9 以降でバンドルされるようになったものなので、5.8.8 だとこけます。
困ったなと思ったら、上述のようにいったん -l (small L) オプションつきで Module::CoreList をインストールした上で、それを -I オプション(large i)で使って cpanm を起動する方法をLingrで教えてもらいました。

ということで、だいぶマイナーかもしれませんが困った人は上記のようにしましょう。