11

I got a Pi a while ago and I'm wondering if Raspbian comes with Perl? If so, what version?

4 Answers 4

9

Yes, at the moment Perl version 5.14.2 is what you get when doing "apt-get install perl" with /etc/apt/sources.list pointing to the "The master Raspbian repository"

You can browse the packages here:

http://archive.raspbian.org/raspbian/pool/main/p/perl/

2
5

If you wish to upgrade the version of perl you are using (on any system) it's generally good practice to stay well away from system perl and build your own.

Depending on your requirements you may wish to have you own copy in your home directory, or a 'for my apps' copy in somewhere like /opt/site-perl/ (I made that path up as an example).

The easiest way to do this is with perlbrew: https://metacpan.org/release/App-perlbrew

The documentation is pretty good, but basically it's:

# to install somewhere other than ~/perl5
export PERLBREW_ROOT=/opt/perl5
# make perlbrew install itself under the given PERLBREW_ROOT
curl -kL http://install.perlbrew.pl | bash

After that I'd install cpanminus:

perlbrew install-cpanm

From there you can install any CPAN modules you require quite simply using:

cpanm Moose Catalyst DBIx::Class

Voila! You're up-to-date and the system-perl is untouched.

3

The pi does come with perl 5.14.2. However if you are looking at doing any coding yourself it is worth looking at perlbrew (which you can install from the repo) which enables you to install the latest version of perl (which is 5.16 with 5.18 coming out in may) and reduces the risk of you breaking the system maintence scripts by installing modules from cpan.

2

Yes. Perl is "essential" in Debian.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.