App::perlbrew(3pm)

πŸ’– App::perlbrew πŸ’–

okay so bestie, you know how perl versions are like... a whole situation? This is the module that handles it. It's App::perlbrew, from the User Contributed Perl Documentation collection, and it is genuinely the moment. ✨


🌸 NAME 🌸

App::perlbrew β€” manage perl installations in your $HOME. That's it. That's the whole vibe. πŸ πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

no cap, look at how chill this is:

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

# Initialize
perlbrew init

# See what is available
perlbrew available

# Install some Perls
perlbrew install 5.32.1
perlbrew install perl-5.28.3
perlbrew install perl-5.33.6

# See what were installed
perlbrew list

# Swith to an installation and set it as default
perlbrew switch perl-5.32.1

# Temporarily use another version only in current shell.
perlbrew use perl-5.28.3
perl -v

# Turn it off and go back to the system perl.
perlbrew off

# Turn it back on with 'switch', or 'use'
perlbrew switch perl-5.32.1
perlbrew use perl-5.32.1

# Exec something with all perlbrew-ed perls
perlbrew exec -- perl -E 'say $]'

like. install a perl. switch to it. turn it off. it's giving control. 🫢


✨ DESCRIPTION ✨

perlbrew is a program that automates building and installing perl in an easy way β€” it hands you multiple isolated perl environments and a whole mechanism for switching between them. πŸ”

Everything gets installed under ~/perl5/perlbrew. After that you gotta include a bashrc/cshrc that perlbrew provides, so it can tweak your PATH for you. And the payoff?? You never have to run sudo commands to install cpan modules, because those live inside your HOME too. no sudo, no stress, no tears. πŸ˜­πŸ’š

For the docs on actually using perlbrew, go read the perlbrew command on MetaCPAN <https://metacpan.org/>, or run perlbrew help, or swing by perlbrew's official website <https://perlbrew.pl/>. The documentation you're reading right now is the API of the App::perlbrew module β€” and fair warning, it may not be remotely close to what you actually want to read. πŸ™ˆ

πŸŽ€ INSTALLATION πŸŽ€

Easiest path, periodt: use the perlbrew installer. Just paste this into your terminal:

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

Or this one, if you have fetch (which is the default on FreeBSD):

fetch -o- https://install.perlbrew.pl | sh

After that, perlbrew installs itself into ~/perl5/perlbrew/bin, and you should follow the instruction on screen to modify your shell rc file so it lands in your PATH. 🐚

The installed perlbrew command is a standalone executable that can be run with system perl. The minimum required version of system perl is 5.8.0, which honestly should be good enough for most of the OSes these days. πŸ’€

A fat-packed version of patchperl also gets installed into ~/perl5/perlbrew/bin β€” you need that one to build old perls. 🧰

The directory ~/perl5/perlbrew will contain all the installed perl executables, libraries, documentations, lib, site_libs. Throughout the docs, that directory is referred to as the "perlbrew root". If you need to point it somewhere else β€” say your HOME has limited quota β€” you can do that by setting the PERLBREW_ROOT environment variable before you run the installer:

export PERLBREW_ROOT=/opt/perl5
curl -L https://install.perlbrew.pl | bash

So as a result, different users on the same machine can all share the same perlbrew root directory β€” although only the original user that made the installation would have permission to perform perl installations. (sharing is caring but permissions are permissions, bestie 😌)

If you need to install perlbrew using a Perl that isn't either /usr/bin/perl or /usr/local/bin/perl, set and export the environment variable PERLBREW_SYSTEM_PERL and then install as described above. ⚠️ Note that you must not use a perlbrew-managed perl for this.

You may also install perlbrew from CPAN:

cpan App::perlbrew

In this case, the perlbrew command is installed as /usr/bin/perlbrew or /usr/local/bin/perlbrew or others, depending on the location of your system perl installation.

Please make sure not to run this with one of the perls brewed with perlbrew. If you're upgrading, it's the best to turn perlbrew off before you run that:
perlbrew off
cpan App::perlbrew

You should always use system cpan (like /usr/bin/cpan) to install App::perlbrew, because it will be installed under a system PATH like /usr/bin, which is not affected by the perlbrew switch or use command. 🎯

The self-upgrade command will not upgrade the perlbrew installed by the cpan command β€” but it's also easy to upgrade perlbrew by running cpan App::perlbrew again. πŸ”


🌈 PROJECT DEVELOPMENT 🌈

The perlbrew project <https://perlbrew.pl/> uses github <https://github.com/gugod/App-perlbrew/issues> for issue tracking. Issues sent to these two systems will eventually be reviewed and handled. To participate, you need a github account. πŸ™

Please briefly read the short instructions about how to get your work released to CPAN:

<https://github.com/gugod/App-perlbrew/blob/develop/CONTRIBUTING.md>


πŸ‘‘ AUTHOR πŸ‘‘

Kang-min Liu "<gugod@gugod.org>"


Copyright (c) 2023 Kang-min Liu "<gugod@gugod.org>".


πŸ“ LICENCE πŸ“

The MIT License


🚨 DISCLAIMER OF WARRANTY 🚨

okay bestie this next bit is the serious one, and it is all caps for a reason. Read it, fr fr:

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

and that's the whole page, bestie!! πŸŽ‰ this one came from perl v5.40.1, dated 2025-10-03, sitting pretty in the User Contributed Perl Documentation section as App::perlbrew(3pm). go forth and brew responsibly πŸ’…πŸ§šβœ¨

πŸ“¦ where this page comes from