1752364 Members
5923 Online
108787 Solutions
New Discussion юеВ

Re: Wrong perl version

 
SOLVED
Go to solution
Nuon Admin
Occasional Advisor

Wrong perl version

Hello co-admins,

On a "HP-UX iron B.11.11 U 9000/800" server when I type perl -v I get the following message:

This is perl, version 5.005_02 built for PA-RISC1.1 ,etc...

When I do /opt/OV/contrib/perl/bin/perl -v I get the following message:

This is perl, v5.6.1 built for PA-RISC2.0-thread-multi

This is the version 5.6.1 I want. When I do swlist|grep -i perl I get:
perl B.5.6.1.F Perl Programming Language

This is the right version.

- How do I remove the old version 5.005_02?
- When I type perl -v I want to see and use the newer version 5.6.1.

Thanks in advance,
Erwin
6 REPLIES 6
Doug Burton
Respected Contributor

Re: Wrong perl version

You may want to try this:

After loading the latest Perl version, you will need to rename a file and create a link.
mv /usr/contrib/bin/perl /usr/contrib/bin/perl.old
ln -s /opt/perl/bin/perl /usr/contrib/bin/perl

Doug Burton
Respected Contributor

Re: Wrong perl version

Forgot to mention that the standard install location is /opt/perl unless things have changed. Just change the link as needed if perl is located in another location.

Robert-Jan Goossens_1
Honored Contributor
Solution

Re: Wrong perl version

Hi

Or change the order in your PATH variable(.profile /etc/profile).

PATH=/usr/sbin:/OV/contrib/perl/bin/:usr/bin......

Regards,
Robert-Jan
H.Merijn Brand (procura
Honored Contributor

Re: Wrong perl version

5.005_02 is old, but so is 5.6.1

The most recent version of perl in the 5.6.x track is 5.6.2, and the most recent stable is 5.8.7 (with 5.8.8 to be expected in the next couple of weeks)

It might be very worthwhile to consider an upgrade anyway.

FWIW the 5.6.1 version that was shipped with OV does most likely not include all the modules you need, and it is thinkable that new modules won't build against it, since the main reason for 5.6.2 to be released was to have it up to date with more recent operating systems.

Furthermore, the 5.6.x builds are unable to use binary modules from the 5.005_xx branche, since these are binary incompatible.

Fetch 5.8.7 from:
http://hpux.connect.org.uk/hppd/hpux/Languages/perl-5.8.7/
or from my HP ITRC site pages (please use LA as primary choice):

USA Los Angeles http://mirrors.develooper.com/hpux/
SGP Singapore https://www.beepz.com/personal/merijn/
USA Chicago http://ww.hpux.ws/merijn/
NL Hoofddorp http://www.cmve.net/~merijn/

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Howard Marshall
Regular Advisor

Re: Wrong perl version

The 5.00 version that you see is the default one that comes packaged on the 10.20 install cd. The reason you get that version when you just type perl is that the shell is searching down the list in the path and executing the first "perl" it comes to. In your case that's the one that came with hp-ux.

There are a couple of approaches to correcting this. First find out which perl your running using the "which" command. Then you can either move that path to a location after the path to the perl you want, but you will have to do that for every user who uses this version of perl. Or. You can rename the file to perl.old or something along those lines and then see "which" perl is found next till you get the correct one. Or. You could rename the file and create a symbolic link from perl in that directory to the correct one. Or. You could add an alias in your profile where perl=/yourpath/bin/perl and let the shell take it from there. Or. You could specify which perl you would like to run in the script its self using the #!/yourpath/bin/perl as the first line of each script.

Personally, I would rename the old perl and any other perl executables till except "the one" and also specify the path on the first line of the scripts.

That's the beauty of Unix though, you can approach it how ever you want.

H
Nuon Admin
Occasional Advisor

Re: Wrong perl version

I have found a solution to this question as seen in the comments below.