in Projects

Use Perlbrew to Run a Recent Version of Perl

I finally decided to use Perlbrew for a new project I’m working on. Perlbrew makes it easy to manage multiple versions of perl on the same machine. I deployed a new instance with Debian 7. Debian 7 ships with perl 5.14.0. I wanted to use 5.18.0 (mostly to feel bad about using the smart match operator). Perlbrew makes it easy:

curl -L | bash
perlbrew install perl-5.18.0
perlbrew switch perl-5.18.0

That’s it:

perl -v
This is perl 5, version 18, subversion 0 (v5.18.0) built for x86_64-linux

Perlbrew twiddles $PATH to use the path it installed perl to (defaults to ~/perl5/perlbrew). You can install other versions besides each other and switch to whichever one is convenient. I’ll finally have something newer than 5.10.0 on my Mac.

Extra: One feature looks particularly useful for testing:

perlbrew exec

This command will run the specified script against all installed versions of perl. Why did I wait this long?

Write a Comment


  • Related Content by Tag