Installing and configuring Perl using perlbrew on macOS or Linux

  • Installing Perl using Perlbrew. It will be a Perl installation separate from macOS's system Perl (/usr/bin/perl).

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

Put the appropriate initialization command into ~/.bashrc:

if <span class="createlink">bashrc </span>; then
    source ~/perl5/perlbrew/etc/bashrc
fi

Open a new terminal.

  • Upgrade perlbrew

      perlbrew self-upgrade
    
    
  • Install or upgrade perl

Replace with X.Y.Z with the latest stable version found on https://www.perl.org/get.html:

perlbrew install perl-X.Y.Z

Tell perlbrew which version of Perl to use:

perlbrew use X.Y.Z

Upgrade Perl:

perlbrew upgrade-perl

It can be a slow process, monitor the log:

tail -f ~/perl5/perlbrew/build.perl-X.Y.Z.log

  • Verify perl installed correctly:

      perlbrew use X.Y.Z
      perl -V
    
    

Verify that $HOME/perl5/lib/perl5 is in @INC.

  • Install cpanm

      perlbrew install-cpanm
    
    
  • Install Perl modules using cpanm

Markdown::Foswiki, a Perl module for Markdown-to-TWiki conversion:

cpanm Markdown::Foswiki

experimental module:

cpanm experimental

blog comments powered by Disqus