Skip to content
Kang-min Liu edited this page Oct 4, 2024 · 129 revisions

Perlbrew

perlbrew is an admin-free perl installation management tool. The latest version is 1.00, read the release note: Release 1.00. Also, check out the special releasse notes: Perlbrew 1.00.

For a quick installation, do this:

\curl -L https://install.perlbrew.pl | bash

Check the document of Installation for more descriptions and options.

Quickstart

After installing perlbrew itself, now it is time to install some versions of perl

To install the latest stable release, and use it as default in the current shell and in all future shell sessions.

perlbrew install perl-5.36.1
perlbrew switch perl-5.36.1

To play with the bleeding-edge version, but only in the current shell:

perlbrew install perl-blead
perlbrew use perl-blead

Runs myprogram.pl against all installations of perl, especially helpful when running tests:

perlbrew exec perl myprogram.pl

For basic usage cheatsheet:

perlbrew -h

For more descriptions about commands,

perlbrew help

What is perlbrew

perlbrew is a tool to manage multiple perl installations in your $HOME directory (or wherever you specify). They are completely isolated perl universes, and has no relationship with system perl, or between each others.

This approach has many benefits:

  • No need to run sudo to install CPAN modules, any more.
  • Try the monthly released new perls with ease and learn new language features.
  • Test your code against different perl versions.
  • Avoid some usual hazards when using verndor perl (the one that comes with OS) for running your app, for example:
    • Vendor perl usually serves its own purposes, and it might be a bad idea to mess it up too much. upgrade CPAN modules provided by vendor might already be a bad idea.
    • Upgrading vendor perl usually comes with upgrade of all CPAN modules that comes with it -- which may not be desired.
    • Some vendors introduced their own perl bugs, twice!
  • For hacking perl internals, and thus required to install multilpe versions from specific commits in perl5.git
  • Just to keep up with fashion and use the latest perl release all the time.

You may optionally chose alternative places for installation, or even let multiple uses share the whole perlbrew environment.

Articles

More Articles

Development

perlbrew has always been improving, it is an open source project for everyone to participate. There are currently over 145 contributors and growing. The code repository is located on github. Feel free to send a bug report, a pull request, or a beer. Everything helps :)

Clone this wiki locally