Last summer I decided I would learn Perl.  I had put it off for a long time, but after trying and failing at learning Python, I decided to give Perl a go.

Managing the perl installations has been tedious.  I tend to use a lot of the features in v5.10, but MacPorts keeps installing older and newer versions and making the perl command point to v5.08 for some reason.  But today I found App::perlbrew.

App::perlbrew makes it easy to install Perl into your home directory, or anywhere else for that matter.  If you install perl into your home directory, you can install whatever modules you like, without needing root access/applicable permissions.

On my Mac, all I had to do to install the latest version of Perl was:

curl -L | bash
echo "source ~/perl5/perlbrew/etc/bashrc" >> .bashrc
perlbrew install perl-5.14.0

And away the installer goes!  When the installer has finished (a fair while using my old MacBook), you simply tell perlbrew that you want to use the newly installed version using the following command:

perlbrew switch perl-5.14.0

Now we can see that the new perl is installed and is running from our home directory:

perl -v | grep version
This is perl 5, version 14, subversion 0 (v5.14.0) built for darwin-2levelbash-3.2
which perl

How very convenient!

Tagged on:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>