I installed Perl 5.12 on my server, but when I try to check what version is running is says 5.10.
I had 5.10 installed previously, so how can I deactivate this older version and make 5.12 the default one? I'm running on Fedora.
migrated from stackoverflow.com Apr 19 '11 at 19:20
This question came from our site for professional and enthusiast programmers.
In general, you do not want to delete/uninstall the system perl. That's bad.
Instead, just add the path that the new perl is installed to to your PATH. Or symlink or hardlink that perl into a location in your PATH.
The problem is that your system is tested against a specific level of Perl. Tools that come with the distro you're on may not be updated to work with a newer level of perl. Further, if you have a binary distro (e.g., one based on debian or RPM, among others), you may install something from your distro that includes a perl module that includes XS (C code), and that debian/RPM/whatever will not necessarily work with the new version of Perl (crossing the 5.8/5.10 boundary was definitely a no-no).
So you should leave the system perl alone.
What I have done is: add ~/bin to my PATH, before /usr/bin, and then hardlink perl there to the desired Perl (I have more than one). Then I can run "perl tool" if I want to use my perl, or I can use "#!/home/myuser/bin/perl" as the first line to achieve the same idea. But, for system tools, which usually live in /usr/bin or /usr/sbin, they will have "#!/usr/bin/perl" as the first line, and be run by that perl.
Don't mess with your distro. You'll be on your own if anything goes wrong.
First, you need to check to see if your using the new version of perl or old (did you uninstall the old version before installing new version? To do this do:
Then you need to check your install media to see where it installed the new version. if its not the same directory then you need to either update your path to search the directory where you installed the new version of perl before it checks the directory where the old version of perl or just uninstall the old version
As noted, check your path. Run which(1) to see where it's finding the perl binary that's getting executed:
And you don't need to uninstall the old version (although you might want to): some scripts you run might require the older version. You never know.
Make sure your perl scripts have a shebang as the first line (the command shell uses that to pick the interpreter for the script being executed). A shebang line for perl looks something like:
If your perl script's shebang looks like
you'll get the perl binary installed at that location.