I'm using Linux, and wanted to install the latest version of Perl, as according to the perl -v command, I had version 5.26.2, and the latest (stable) release is 5.30.0. But when I compiled the source, perl -v still returned 5.26.2! Why did this happen?

Here's what I did:

I acquired a copy of the Perl source from this site, unpacked it, and followed the installation instructions specified in README (the plain one, not any of the ones with .os at the end:)

./Configure -des -Dprefix=$HOME/localperl
make test
make install

I then ran perl -v to determine whether it worked, and it returned that I still had v5.26.2.

  • You might find better answers at unix.stackexchange.com – Christopher Hostage Jun 10 '19 at 22:42
  • Maybe there are two perl executables on your path. Try type -a perl to see. – Ken Jackson Jun 10 '19 at 22:46
  • @KenJackson, what you suggested returned perl is /usr/bin/perl. I'm not sure what this means. – Blue-Maned Hawk Jun 10 '19 at 22:56
  • That's the version that's running, @Blue-Maned Hawk, not the one you compiled in your home directory. Put this in your ~/.bashrc file: PATH="$HOME/localperl/bin:$PATH" and execute it: . $/.bashrc. (That's the directory your compiled perl is in, isn't it?) – Ken Jackson Jun 11 '19 at 0:07
  • I'll try that, and comment again if it works. Any particular place? – Blue-Maned Hawk Jun 11 '19 at 1:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.