Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I had perl version 5.8.8 installed in my system. I have installed 5.10.0 at /usr/local/bin/perl. but when i restarted my linux box now the default perl path has been changed.

which perl

I want to use perl version 5.10.0 but also want to keep default path to /usr/bin/perl (version 5.8.8).

I have tried to make an alias in my bash profile but after doing this I am not able to use perl 5.10. Can you please suggest me the way to fix this issue.

share|improve this question
up vote 6 down vote accepted

Check your $PATH and make sure that /usr/local/bin comes after /usr/bin

echo $PATH
share|improve this answer

You need to learn about the PATH environment variable. Do in a terminal:

   echo $PATH

You'll see the different directories where binaries are looked for. Usually, you'll have /usr/local/bin before /usr/bin. You can modify the PATH variable in your ~/.profile or ~/.bash_profile.

Yours, david

share|improve this answer

simply declare:
use 5.10.0;

have a look in "Location of Perl" chapter in perlrun

share|improve this answer
This only enables new features such as 'say "bla";' in perl. It does not do anything with regards to what perl you use. – MichielB Aug 31 '11 at 19:30

In general, using a different perl on your linux box than the system perl can be really messy, especially if you want to use multiple modules. This is because all the modules that have C code require compilation and will be dependent on your perl version. For instance if you use DBD::mysql the 5.8 version does not work for 5.10.

The 'modern' answer to this nowadays is to use perlbrew and install a different perl in your home directory, you can even have multiple.

Then you can use cpanminus to install the modules you need. You'd have installed the devel modules for mysql in order to be able to compile the module, but it will work neatly and will not break the rest of your system.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.