Install Perlbrew

Perlbrew is a tool to manage multiple perl installations in your home directory. They are completely isolated perl installations. See the perlbrew homepage is at

Install Perlbrew

Run the following command to download and install perlbrew: curl -L | bash

$ curl -L | bash

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1410  100  1410    0     0   1284      0  0:00:01  0:00:01 --:--:--  1284

Installing perlbrew
Using Perl </usr/bin/perl>
perlbrew is installed: ~/perl5/perlbrew/bin/perlbrew

perlbrew root (~/perl5/perlbrew) is initialized.

Append the following piece of code to the end of your `~/.bash_profile and start a
new shell, perlbrew should be up and fully functional from there:

    source ~/perl5/perlbrew/etc/bashrc

Simply run `perlbrew` for usage details.

Happy brewing!

Init and Edit .bashrc

Now according to the install instructions you need to do a “once off”, perlbrew init.

$ perlbrew init
Perlbrew environment initiated, required directories are created under


Paste the following line(s) to the end of your ~/.bashrc and start a
new shell, perlbrew should be up and fully functional from there:

    source ~/perl5/perlbrew/etc/bashrc

For further instructions, simply run `perlbrew` to see the help message.
Enjoy perlbrew at $HOME!

and as it suggested above add the source line to your ~/.bashrc file.

Note: If you install another local perl system like “Linux Brew” you probably do not want to have this source line in your ~/.bashrc.

Example, Installing a Perlbrew Perl Instance

List what perl instances are available. Note that odd numbered perl versions like perl-5.27.6 are development versions! You should use an even numbered version like perl-5.26.1.

$ perlbrew available

Lets install perl-5.26.1

The install instruction say to use perlbrew -v install perl-xx.yy.z but I found that the install would fail. The suggestion to use force i.e. perlbrew --force install perl-5.26.1 also fails. Use --notest. See reference at end.

$ perlbrew install perl-5.26.1 --notest

Fetching perl-5.26.1 as /shared/homes/xxxxxx/perl5/perlbrew/dists/perl-5.26.1.tar.gz
Installing /shared/homes/xxxxxx/perl5/perlbrew/build/perl-5.26.1 into 

This could take a while. You can run the following command on another shell to
track the status:

    tail -f ~/perl5/perlbrew/build.log

Installed /shared/homes/xxxxxx/perl5/perlbrew/build/perl-5.26.1 as perl-5.26.1 successfully. 
Run the following command to switch to it.

    perlbrew switch perl-5.26.1

You can list what perls you have installed with:

$ perlbrew list
  * /usr/bin/perl (5.10.1)

General Usage

To use an installed perl just type perlbrew switch perl_version:

$ which perl

$ perlbrew switch perl-5.26.1
$ which perl

To return to your original perl use perlbrew off

$ perlbrew off

perlbrew is switched off. Please exit this shell and start a new one to make it effective.
To immediately make it effective, run this line in this terminal:

    exec /bin/bash

$ which perl

If you just want to play with a version of Perl in the current shell, just use this command:

perlbrew use perl-5.26.1

Remember to get help just type: perlbrew help

Installing Perl Modules within Perlbrew

We will need to install cpanm to manage your perl modules. Perlbrew comes with an option to do that for us. This just installs perl5/perlbrew/bin/cpanm.

$ perlbrew install-cpanm

Useful Things

Set a useful Bash Prompt

In your .bashrc set your PS1 variable like this:

PS1="`perlbrew list | grep \* | sed s/'* '//`$ "

Now your bash prompt will show the version of Perl that is in effect.



Trouble Installing New Version of Perl Using Perlbrew

References for Perlbrew: and

Alternatives to Perl Brew: plenv

This is custom footer