plenv
Install
#install plenv git clone https://github.com/tokuhirom/plenv.git ~/.plenv echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(plenv init -)"' >> ~/.bashrc exec $SHELL -l #install perl-build git clone https://github.com/tokuhirom/Perl-Build.git ~/.plenv/plugins/perl-build/ |
How to use plenv
#show the list of available perl(Display installable perl list) plenv install --list #install plenv install 5.8.8 #check the installed perl plenv versions #designate using version of perl(global) plenv global 5.8.8 #designate using version of perl(local) plenv local 5.8.8 #exec this after installation(To enable installed Perl) plenv rehash #check the current version of perl plenv version #install cpanm to local plenv install-cpanm #if below error occur, modify install script. vi .plenv/libexec/plenv-install-cpanm >curl -Lk http://cpanmin.us/ | plenv exec perl - App::cpanminus #new #check the path of cpanm plenv which cpanm #check the installed modules plenv list-modules |
How to migrate installed modules from system to plenv's perl by plenv
Carton
cpanm Carton #make cpanfile in advance #install modules(save to current_dir/local/) carton install #check cpanfile.snapshot(This file is made by carton install. When you execute bundle install, it's necessary) ls cpanfile.snapshot #copy tarball from local dir to vendor dir carton bundle |
Make cpanfile(like Gemfile)
git clone https://gist.github.com/5883207.git make_cpanfile cd make_cpanfile perl installed2cpanfile > cpanfile |
参考書籍: