perlbrew - Perl Environment manager.
perlbrew <command> [options] [arguments] Commonly used commands: init Initialize perlbrew environment. install Install perl uninstall Uninstall the given installation available List perls available to install list List installed perls use Use the specified perl in current shell off Turn off perlbrew in current shel switch Permanently use the specified perl as default switch-off Permanently turn off perl mirror Pick a preferred mirror site version Display version help Read more detailed instructions Examples: perlbrew install perl-5.14.1 perlbrew install 5.12.1 perlbrew list perlbrew use perl-5.12.3 perlbrew switch perl-5.14.1
If you never run perlbrew before, or you do not have a ~/.perlbrew directory, you should perform the initialization process by running:
~/.perlbrew
perlbrew init
This step needs to be done only once.
If latter on you need to change $PERLBREW_ROOT, you (and all other users who share the same $PERLBREW_ROOT will have to run this again to make it affective.
$PERLBREW_ROOT
Build and install the given version of perl.
Version numbers usually look like "5.x.xx", or "perl-5.xx.x-RCx" for release candidates.
The specified perl is downloaded from the CPAN website, unless mirror setting are present.
A special way to install the blead version of perl, which is downloaded from this specific URL regardless of mirror settings:
http://perl5.git.perl.org/perl.git/snapshot/blead.tar.gz
Build and install from the given git checkout dir.
Build and install from the given archive file.
Build and install from the given URL. Supported URL schemes are http://, https://, ftp:// and file://.
http://
https://
ftp://
file://
Uninstalls the given version.
Use the given version perl in current shell. This will not effect newly opened shells.
Without a parameter, shows the version of perl currently in use.
Switch to the given version, and makes it the default for this and all future terminal sessions.
Without a parameter, shows the version of perl currently selected.
List the installed versions of perl.
List the available versions of perl on CPAN.
Temporarily disable perlbrew in the current shell.
Re-enables the default system Perl, whatever that is.
Permananently disable perlbrew. Use switch command to re-enable it.
switch
Create an alias for the installation named <name>.
Rename the alias to a new name.
Delete the given alias.
Run this if you want to choose a specific CPAN mirror to install the perls from. It will display a list of mirrors for you to pick from. Hit 'q' to cancel the selection.
Execute command for all perls.
For example, run a Hello program:
perlbrew exec perl -e 'print "Hello from $]\n"'
The output depends on your perl installations, and looks like this:
perl-5.12.2 ========== Hello word from perl-5.012002 perl-5.12.3 ========== Hello word from perl-5.012003 perl-5.13.10 ========== Hello word from perl-5.013010 perl-5.14.0 ========== Hello word from perl-5.014000
Notice that the command is not executed in parallel.
Low-level command. Use this command to see the list of environment variables that are set by perlbrew itself for shell integration.
perlbrew
The output is something similar to this (if your shell is bash):
export PERLBREW_ROOT=/Users/gugod/perl5/perlbrew export PERLBREW_VERSION=0.28 export PERLBREW_PATH=/Users/gugod/perl5/perlbrew/bin:/Users/gugod/perl5/perlbrew/perls/current/bin export PERLBREW_PERL=perl-5.14.1
You can also ask for the proper variables for a specific perl version.
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.
perl
perl5.13.6
You don't need to do this unless you have been using old perlbrew to install perls. The installation layout is changed since version 0.11.
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:
perlbrew switch
perlbrew symlink_executables perl-5.13.6
This essentially creates this symlink:
${PERLBREW_ROOT}/perls/perl-5.13.6/bin/perl -> ${PERLBREW_ROOT}/perls/perl-5.13.6/bin/perl5.13.6
Newly installed perls, whether they are development versions or not, does not need manually treatment with this command.
Install the cpanm standalone executable in $PERLBREW_ROOT/bin.
cpanm
$PERLBREW_ROOT/bin
For more rationale about the existence of this command, read <http://www.perlbrew.pl/Perlbrew-and-Friends.html>
This command upgrades Perlbrew to its latest version.
Show the version of perlbrew.
prints this help.
Force installation of a perl.
Enable parallel make and test (if supported by the target perl)
perlbrew install -j 5 perl-5.12.3
Skip the test suite
Log output to a log file rather than STDOUT. This is the default. The log file is saved as $PERLBREW_ROOT/build.log, which is, by default, ~/perl5/perlbrew/build.log.
Log output to STDOUT rather than a log file.
Install a given perl under an alias.
perlbrew install perl-5.6.2 --as legacy-perl
pass through switches to the perl Configure script.
perlbrew install perl-5.10.1 -D usemymalloc -U uselargefiles
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 before running perlbrew.
$ENV{HOME}/perl5/perlbrew
bashrc
If you upgraded perlbrew from version 0.16 or older, you should do this cleanup your setup. Failure to do so might make the use command to fail.
use
Note the version of perl currently selected with perlbrew switch. Then turn perlbrew off, and switched back again with perlbrew switch previous-perl-version.
perlbrew off
perlbrew switch previous-perl-version
App::perlbrew, App::cpanminus
To install App::perlbrew, copy and paste the appropriate command in to your terminal.
cpanm App::perlbrew
CPAN shell
perl -MCPAN -e shell install App::perlbrew
For more information on module installation, please visit the detailed CPAN module installation guide.