User Tools

Site Tools


sysadmin_misc:perlbrew

Perlbrew

Introduction

This article details how to manage a recent perl in your homedir. The main advantage is that you will never mess up your distribution's perl again with cpan updates of some key modules.

Perlbrew installation

  • First install perlbrew using cpan on the system perl : sudo cpan App::perlbrew
  • An alternative method is to get a more recent perlbrew from metacpan. I had to do this to accomodate the system perl update to 5.16 on my gentoo systems : wget, untar, perl Makefile.PL, make, sudo make install.

Perlbrew configuration

  • Choose where to install your perls : export PERLBREW_ROOT=$HOME/.perl5 && mkdir -p $PERLBREW_ROOT
  • Make this choice persistent by appending the following to your .bashrc :
if [ -d "$HOME/.perl5" -a -f "$HOME/.perl5/etc/bashrc" ]; then
    export PERLBREW_ROOT=$HOME/.perl5
    source $HOME/.perl5/etc/bashrc
fi
  • Init perlbrew :
perlbrew init
perlbrew install-cpanm
perlbrew install-patchperl

Manage your perls with perlbrew

  • Use perlbrew available to list available perls
  • Install with perlbrew install
  • Switch to your new perl with perlbrew switch
sysadmin_misc/perlbrew.txt · Last modified: 2018/09/25 15:00 (external edit)