Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I use perl 5.12 in Ubuntu? There is no distribution package on Ubuntu.

I have to use feature 'unicode_strings'; in my perl code, and this is available from 5.12. I try to install perl on Ubuntu by apt-get install perl, but 5.10 is the latest version.

How can I deal with this? Or is there any code in 5.10 can replace the code feature 'unicode_strings';?


share|improve this question

migrated from Aug 16 '12 at 12:45

This question came from our site for professional and enthusiast programmers.

you may consider downloading .deb package and installing it from dpkg. the command for a .deb package:

dpkg -i my.deb

you may find the deb file for perl 5.12 in here named: perl_5.12.3-6ubuntu4_i386.deb (3.4 MiB)

it will probably want another package and another one want another one..... recursively :) but it's always possible to install like this.

share|improve this answer
But it seems like a 32bit version right? I have a 64bit ubuntu. – Denzel Aug 16 '12 at 3:22
also you may update your sources for apt and hopefully you'll find a newer version of perl. for example i just looked for a debian mirror ( and see perl 5.14 there – alpera Aug 16 '12 at 3:23
you can find an 64bit version too, here it is: the way i dont like installing packages manually so use this process with your own risk, i'm not responsible if a critical machine breaks down. :) – alpera Aug 16 '12 at 3:28
Yes, a breakdown can be horrible... – Denzel Aug 16 '12 at 3:34
Because I am not using my own server now, too terrible. – Denzel Aug 16 '12 at 3:35

When writing your own applications, I recommend installing your own Perl. This was once a major pain, but no more. Nowadays, you can use perlbrew to build Perl for you.

On Ubuntu, I think you'll need the build-essential package first, if you don't already. After that, you can use the instructions on the perlbrew docs linked above to install it (or use cpan App::perlbrew).

Once installed you can run:

perlbrew init
perlbrew install perl-5.12.2
perlbrew switch perl-5.12.2

Once you do that and make sure Perlbrew's bashrc is loaded into your bashrc, you should be ale to run:

perl -v

and see that you're running 5.12.

Edit (Joel Berger):

The official perlbrew website is and it suggests installing by running

wget --no-check-certificate -O - | bash

Then you will still need to

perlbrew install perl-5.12.2
perlbrew switch perl-5.12.2

of course. Finally if you have multiple cores (and who doesn't these days) you can run

perlbrew install -j N perl-5.12.2

where N is the number of jobs requested, often the number of cores you have plus one. I use -j 5 on my quad-core and -j 3 on my dual-core netbook.


share|improve this answer
following the comments on alpera's answer, I also want to state that using this method, the new Perl is installed in your own userspace. Repeat it does not affect the system Perl at all. You have your own copy of whichever Perl version(s) you want. This is the best choice for you. – Joel Berger Aug 16 '12 at 4:32

Anyway you can easily download last Perl distribution (5.16 or 5.14) and install it:

1. Install Perl

tar -xzf perl-5.16.0.tar.gz
cd perl-5.16.0
./Configure -des -Dprefix=$HOME/usr/local
make test
sudo make install

then add:

export PATH=$HOME/usr/local/bin/:$PATH

as result you will get:

 $ perl -v 
 $ perl 5.16

Old perl version is still locate here: /usr/bin/perl

new Perl version will be there: /usr/local/bin/perl

2. Work with CPAN modules

I suggest you install cpanminus (cpanm) for easy manage CPAN modules for new version of Perl.

tar -xzf App-cpanminus-1.5017.tar.gz
cd App-cpanminus-1.5017
make test
sudo make install

After that you can install CPAN modules for your new version of Perl.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.