Operating System - Linux
1748201 Members
3899 Online
108759 Solutions
New Discussion юеВ

two versions of perl, one works, cpan wants to use bad one

 
Brian Bartley
Frequent Advisor

two versions of perl, one works, cpan wants to use bad one

All,
On our system, HP 11.11, we have three perl executables:

# /opt/perl/bin/perl -v
This is perl, v5.6.1 built for PA-RISC1.1-thread-multi

# /usr/local/bin/perl -v
This is perl, v5.8.7 built for PA-RISC2.0

# /usr/contrib/bin/perl -v
This is perl, version 5.005_02 built for PA-RISC1.1

The installation of v5.8.7 is broken and doesn't work at all, it never has. v5.6.1 came with 11.11, it works and runs a critical application.

I'd like to install the Net::SFTP module. When I try to run cpan I get a big long error, here's part of it:
# cpan -v
Can't locate loadable object for module IO in @INC (@INC contains: /usr/local/lib/perl5/5.8.7/PA-RISC2.0 /usr/local/lib/perl5/5.8.7 /usr/local/lib/perl5/site_perl/5.8.7/PA-RISC2.0 /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl .) at /usr/local/lib/perl5/5.8.7/PA-RISC2.0/IO/Handle.pm line 260
Compilation failed in require at /usr/local/lib/perl5/5.8.7/PA-RISC2.0/IO/Handle.pm line 260.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.8.7/PA-RISC2.0/IO/Handle.pm line 260.
Compilation failed in require at /usr/local/lib/perl5/5.8.7/PA-RISC2.0/IO/Seekable.pm line 101.

It appears the cpan program is looking for perl files in /usr/local/lib/perl5/5.8.7, but that's the broken version. The working version of perl, v5.6.1 shows this output when the /opt/perl/bin/perl -V command is issued:
@INC:
/opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi
/opt/perl/lib/5.6.1
/opt/perl/lib/site_perl/5.6.1/PA-RISC1.1-thread-multi
/opt/perl/lib/site_perl/5.6.1
/opt/perl/lib/site_perl
.

I'd like to install the module in the working version of perl at /opt/perl/bin/perl(v5.6.1), not the broken version in /usr/local/bin/perl(v.5.8.7). Is there a way to point the cpan program to the correct perl version? Also it would be nice if I could fix the v.5.8.7 version as well, but I'd be happy to settle for having v5.6.1 in a state where I can add modules to it. Thanks,

Brian

Brian Bartley
Campus Card Services
Indiana University
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: two versions of perl, one works, cpan wants to use bad one

Hi Brian:

The current version of Perl is 5.5.8. I urge you to download and install that from either the HP site or Merijn's. Thereafter, fetch the modules you need to add from CPAN.

http://mirrors.develooper.com/hpux/

http://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=PERL

If you have an Ansi C compiler from HP, use the HP-UX site. If you don't, or need to add a 'gcc' compiler, use Merijn's 'gcc' ports. Not all, but some very useful modules, require the compiler to add them, and you will want a match between the compiler that compiles the module and the compiler that compiled the Perl distribution.

Regards!

...JRF...
Brian Bartley
Frequent Advisor

Re: two versions of perl, one works, cpan wants to use bad one

James,
I'm a bit hesitant to install the latest binary depot from HP, that's how the broken version got installed, I'm afraid the same thing will happen again. Also I can't chance damaging the current working version because it runs a critical application. Also I'm a bit leery of getting a compiler and compiling myself, I'm not very experienced at those things.

Right now I'd just be satisfied to get Net::SFTP going on our working version of perl and address the other perl issues later. Thanks,
Brian
Brian Bartley
Campus Card Services
Indiana University
James R. Ferguson
Acclaimed Contributor

Re: two versions of perl, one works, cpan wants to use bad one

Hi Brian:

Your PATH should determine where Perl is first found. Usually a symbolic link of '/usr/bin/perl' points to the principal (default) Perl.

A fresh Perl install will establish this link and provide you a current core base upon which to install new moduels. I wouldn't bother with anything that is not 5.8.x.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: two versions of perl, one works, cpan wants to use bad one

Hi (again) Brian:

> I'm a bit leery of getting a compiler and compiling myself, I'm not very experienced at those things.

Not to fear. Not all modules that you want to add require a compiler, and if and when they do, the CPAN module will automatically perform the compilation and installation for you!

Make sure that '/usr/bin/perl' is a symbolic link that points to your desired version and that '/usr/bin' is at the head of your PATH.

Regards!

...JRF...
Brian Bartley
Frequent Advisor

Re: two versions of perl, one works, cpan wants to use bad one

Thanks for the replies, it will help me make a decision. I'll probably wind up having the HP engineers fix it all on a pay basis, but your replies will help me in that process.

Brian
Brian Bartley
Campus Card Services
Indiana University