Perl should be installed on Mac OS using Brew
$ brew install perl
If perl
is already installed, this will throw an error. You should then install perl with perlbrew
.
Perlbrew is a versions environment for Perl, such as rbenv
for ruby and nvm
for node.
See a complete guide for perlbrew
.
# Installation
curl -L https://install.perlbrew.pl | bash
# Initialize
perlbrew init
# See what is available
perlbrew available
# Install some Perls
perlbrew install 5.18.2
perlbrew install perl-5.8.1
perlbrew install perl-5.19.9
# See what were installed
perlbrew list
# Swith to an installation and set it as default
perlbrew switch perl-5.18.2
# Temporarily use another version only in current shell.
perlbrew use perl-5.8.1
perl -v