Perlbrew is a software to install multiple perl versions in our system without root permissions. Perlbrew is installed in $HOME or in any directory of our file system (for example /opt/soft/perlbrew) with a simple environment variable.
Installing perlbrew
Perlbrew is very simple to install and configure it. In the first reference is explained how to install perlbrew in $HOME. So, I am going to explain a root installation/configuration.
| $ sudo su - # export PERLBREW_ROOT=/opt/perlbrew # curl -L http://xrl.us/perlbrewinstall | bash |
Perlbrew will install in /opt/perlbrew directory. Now, we need some environment variables. For root, we only need the next line in the ~/.bashrc file.
| #.bashrc file source /opt/perlbrew/etc/bashrc |
Now, we can install a particular perl version. For example:
| $ perlbrew install perl-5.14.1 |
Now, the rest of system users need some environment variables to use perlbrew.
| # File .bashrc of any user. source /opt/perlbrew/etc/bashrc PATH=/opt/perlbrew/bin/:$PATH |
If we have a system with a lot of users and we haven't enough space, this would be a way to install and configure it.
Installing cpanm
The next step would be configure cpan for each perl version. Instead of to do that, we can install cpanm (cpan minus) and to save time. We can install cpanm with perlbrew directly or with the source package.
For example, we switch to perl 5.14 (previously installed)
1. With perlbrew:
| $ perlbrew switch perl-5.14.1 $ perlbrew install-cpanm |
2. Downloading the package:
| $ perlbrew switch perl-5.14.1 $ curl -L http://cpanmin.us | perl - App::cpanminus |

0 comentarios:
Publicar un comentario en la entrada
Por favor, no escriba al estilo SMS y use signos de puntuación en caso necesario