■ 環境はCenotOS7
$ cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
$ arch
x86_64
■ いつもどおりにPerlbrewを導入してみる。
$ curl -L http://install.perlbrew.pl | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 315 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 1255 100 1255 0 0 881 0 0:00:01 0:00:01 --:--:-- 1225k
## Download the latest perlbrew
## Installing perlbrew
Can't locate Getopt/Long.pm in @INC (@INC contains: FatPacked::9177400=HASH(0x8c0938) /usr/share/perl5 /usr/lib64/perl5 /usr/local/share/perl5 /usr/local/lib64/perl5) at perlbrew-19108 line 33.
BEGIN failed--compilation aborted at perlbrew-19108 line 33.
Compilation failed in require at perlbrew-19108 line 5795.
BEGIN failed--compilation aborted at perlbrew-19108 line 5795.
そうすると、既にインストールされているはずのパッケージが@INCにパスが登録されていないらしい。
googleで検索すると同様な現象が発生している人が居るらしいです。
https://github.com/gugod/App-perlbrew/issues/409
1月23日の解決策としては、
$ curl -kL http://install.perlbrew.pl | sed "/\$PERLBREWDOWNLOAD/{N;s|$|sed -i -r '/@INC/ s/([)][}])/ vendorlib vendorarch\\\1/' \\\$LOCALINSTALLER\n|}" | bash
として、ワンライナーでvendorlibとvendorarchから参照するようになっていた。
しかし、最近再度調べてみると有志の方がperlbrewのゴニョゴニョしてくれる物をgithubにあげてくださっている模様。
そちらのperlbrewインストール方法としては
$ ( export PERLBREWURL=https://github.com/nnutter/App-perlbrew/raw/develop/perlbrew; \curl -L http://install.perlbrew.pl | \bash )
とワンライナーで読みやすくなった感じです。
実際に両方を試してみて自分の環境では動作確認済みですので、
お好きな方を選んでperlbrewの導入をすることを出来るかと思います。
インストールが完了。
■ perlbrewインストール後のいつもの初期設定
$ ~/perl5/perlbrew/bin/perlbrew init
$ echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bashrc
$ source ~/.bashrc
■ perlbrew向けにcpanmを導入する
$ perlbrew install-cpanm
ということで、CentOS7にperlbrewを導入する暫定対応でした。