By default, perlbrew builds and installs perls into $ENV{HOME}/perl5/perlbrew directory. To use a different directory, set this environment variable in your bashrc to the directory in your shell RC before sourcing perlbrew's RC.

It is possible to share one perlbrew root with multiple user account on the same machine. Therefore people do not have to install the same version of perl over an over. Let's say /opt/perl5 is the directory we want to share. All users should be able append this snippet to their bashrc to make it effective:

export PERLBREW_ROOT=/opt/perl5
source ${PERLBREW_ROOT}/etc/bashrc

After doing so, everone's PATH should include /opt/perl5/bin and /opt/perl5/perls/${PERLBREW_PERL}/bin. Each user can invoke perlbrew switch and perlbrew use to independently switch to different perl environment of their choice. However, only the user with write permission to $PERLBREW_ROOT may install CPAN modules. This is both good and bad depending on the working convention of your team.

If you wish to install CPAN modules only for yourself, you should use the lib command to construct a personal local::lib environment. local::lib environments are personal, and are not shared between different users. For more detail, read perlbrew help lib and the documentation of local::lib.

If you want even a cooler module isolation and wish to install CPAN modules used for just one project, you should use carton for this purpose.

It is also possible to set this variable before installing perlbrew to make perlbrew install itself under the given PERLBREW_ROOT:

By default, perlbrew stores per-user setting to $ENV{HOME}/.perlbrew directory. To use a different directory, set this environment variable in your shell RC before sourcing perlbrew's RC.

In some cases, say, your home directory is on NFS and shared across multiple machines, you may wish to have several different perlbrew setting per-machine. To do so, you can use the PERLBREW_HOME environment variable to tell perlbrew where to look for the initialization file. Here's a brief bash snippet for the given senario.

Low-level command. This command is used to create the perl executable symbolic link to, say, perl5.13.6. This is only required for development version of perls.

You don't need to do this unless you have been using old perlbrew to install perls, and you find youself confused because the perl that you just installed appears to be missing after invoking `use` or `switch`. perbrew changes its installation layout since version 0.11, which generades symlinks to executables in a better way.

If you just upgraded perlbrew (from 0.11 or earlier versions) and perlbrew switch failed to work after you switch to a development release of perl, say, perl-5.13.6, run this command:

If you are upgrading perlbrew from 0.16 or ealier versions to a recent one (0.40-ish), you should do these steps to adjust your perl installations afterwards (you might need to change the value of PERLBREW_ROOT):