CentOS6.2にperlbrewとcpanmを入れる
を参照させて頂きました。
perlbrewのインストール
perlのバージョン確認
$ which perl /usr/bin/perl $ /usr/bin/perl -v This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi Copyright 1987-2009, 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.
perlのコアモジュールをインストール
# yum -y install perl-core
perlbrewのインストール
$ export PERLBREW_ROOT=$HOME/.perlbrew $ curl -L http://xrl.us/perlbrewinstall --insecure | bash
~/.bashrcに~/.perlbrew/etc/bashrcを追加
$ ~/.perlbrew/bin/perlbrew init $ echo 'source ~/.perlbrew/etc/bashrc' >> ~/.bashrc $ source ~/.bashrc
perlのインストール
$ perlbrew install -v 5.16.2
するとエラー発生
I can't find make or gmake, and my life depends on it. Go find a public domain implementation or fix your PATH setting!
make or gmakeが無いらしい。 ググると開発向けのパッケージをまとめてインストールしてくれる "Development Tools"が必要らしい。
Development Toolsインストール後、
# yum groupinstall "Development Tools"
再度perlをインストール
$ perlbrew list perl-5.16.2 $ perlbrew switch 5.16.2 $ perl -v This is perl 5, version 16, subversion 2 (v5.16.2) built for x86_64-linux Copyright 1987-2012, Larry Wall
今度は成功。
CPANMのインストール
$ curl -L http://cpanmin.us/ | perl - App::cpanminus $ perlbrew install-cpanm
pm-uninstallのインストール
cpanm App::pmuninstall
これでPerlの環境構築ができました。