Perl 環境の整備は plenv で。想定は OS X 環境。予め Homebrew で perl-build
をインストールしておく。
CWD=$(pwd)
if ! which plenv &> /dev/null
then
PLENV="${HOME}/.plenv"
if [ ! -d ${PLENV} ]
then
git clone git://github.com/tokuhirom/plenv.git ${PLENV}
else
cd ${PLENV}
git pull
cd ${CWD}
fi
export PATH="${PLENV}/bin:${PATH}"
eval "$(plenv init -)"
unset PLENV
fi
if ! plenv versions | grep 5.21.0 &> /dev/null
then
plenv install 5.21.0
fi
plenv global 5.21.0
plenv rehash
unset CWD
インストール後 ${HOME}/.bash_profile
とかに下記行を追記の事:
export PATH="${HOME}/.plenv/bin:${PATH}"
eval "$(plenv init -)"
[ -f "${HOME}/.plenv/completions/plenv.bash" ] && source "${HOME}/.plenv/completions/plenv.bash"