1823914 Members
3278 Online
109667 Solutions
New Discussion юеВ

PERL @INC error

 
SOLVED
Go to solution
George Chechakunnil
Frequent Advisor

PERL @INC error

Hello Admins,

When i run a perl script i am getting the following error


Can't locate Time/HiRes.pm in @INC (@INC contains: $FindBin::Bin /var/opt/OV/bin/instrumentation /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 .) at /usr/local/bin/itoup line 46.

BEGIN failed--compilation aborted at /usr/local/bin/itoup line 46.

The file are available in

/opt/perl5.8.6/lib/perl5/5.8.6/PA-RISC2.0/auto/Time/HiRes

How can i update this Perl include path @INC to have the correct path?..

#Perl -V end shows

@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
.


Please help

I am like a small boy picking up pebbles in god's vast shore of knowledge --- Sir Issac Newton
7 REPLIES 7
Hein van den Heuvel
Honored Contributor

Re: PERL @INC error

Sounds like a problem with your perl install. I guess the system was upgraded from 5.6.1 to 5.8.6?

Looks like you are still activating the 5.6.1 image.

What is the output for : perl -v
Where does 'which perl' take you?

Google 'perl inc' will give good pointers.
For example, a reminder that a simple way to print the INC array is:

perl -e "print join(\"\n\", @INC);"

Just to try to use the known library you could add it to @INC using:

1. Add the directory to the PERL5LIB environment variable.
2. Add use lib 'directory'; in your Perl script.
3. push @INC/opt/perl5.8.6/lib/perl5/5.8.6/PA-RISC2.0";

But I suspect that will just be the begining of the end.
Ditto for moving the libraries around... it probably will create more confusion.

Check that install!

Hein.






George Chechakunnil
Frequent Advisor

Re: PERL @INC error

1. Which perl

/opt/perl5/bin/perl

2. Attached is the perl -V output

Please help
I am like a small boy picking up pebbles in god's vast shore of knowledge --- Sir Issac Newton
Hein van den Heuvel
Honored Contributor
Solution

Re: PERL @INC error

So that's an old perl.

You have to check with the person responsible for the perl instal whether this is the expected version or whether 5.8.6 was supposed to be available for use.

Look around in the /opt/perl5.8.6 tree.
Does it look like a complete install?
Is there an other, more recent perl executable in there?

Maybe someone tried the 'help' by providing libraries form 5.8.6 on this 5.6.1 install.
I feel bad about that, but if you want to try, then use one of the steps outlined above to point perl to those libraries.

Hein.
H.Merijn Brand (procura
Honored Contributor

Re: PERL @INC error

# corelist Time::HiRes

Time::HiRes was first released with perl 5.007003


This very useful module was put in the core with release 5.7.3, and thus with 5.8.x
It is not a CORE module in 5.6.x and earlier, but can be installed from CPAN:

http://search.cpan.org/~jhi/Time-HiRes-1.9708/

For the curious, 'corelist' will be shipped with 5.10.0, but is also already available on CPAN. Here's a full list for Time::HiRes:

# corelist -a Time::HiRes

Time::HiRes was first released with perl 5.007003
5.007003 1.20_00
5.008 1.20_00
5.008001 1.51
5.008002 1.52
5.008003 1.52
5.008004 1.59
5.008005 1.59
5.008006 1.65
5.008007 1.66
5.008008 1.86
5.009 1.51
5.009001 1.56
5.009002 1.66
5.009003 1.86
5.009004 1.87
5.009005 1.9707

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
George Chechakunnil
Frequent Advisor

Re: PERL @INC error

Thanks but i think my problem is more than Time::HiRes,

I am unable to load any of the modules. Somewhere some path setting is messsed up i guess
I am like a small boy picking up pebbles in god's vast shore of knowledge --- Sir Issac Newton
Ralph Grothe
Honored Contributor

Re: PERL @INC error

I think your difficulties arise from that your script use-es modules from disparate Perl installations.
Apparently, you seem to have a Perl 5.6.1 whose interpreter is either first found in your $PATH or which is referred to in your script's shebang.
Then you have a newer Perl 5.8.6 which already provides Time::HiRes, FindBin and other (formerly supplementary) modules in its core installation which your script might require,
as Merijn has proved to you.
I think it would run if you either changed your $PATH to find the Perl 5.8 interpreter first,
or replaced the symlink /usr/bin/perl to point to /opt/perl5.8.6/bin/perl,
or changed your script's shebang accordingly.
If however you wish to stick to Perl 5.6.1
you need to install the missing modules Time::HiRes and others first.
Madness, thy name is system administration
H.Merijn Brand (procura
Honored Contributor

Re: PERL @INC error

Why are you using the ActivePerl version for HP-UX? This 5.6.1 is not only rather old, but there are much better builds than this one.

I suggest you install one of ...
* the official HP build from the application CD/DVD's or from http://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=PERL
* perl from the HP porting center at http://hpux.connect.org.uk/hppd/hpux/Languages/perl-5.8.8/
* one of my builds at http://mirrors.develooper.com/hpux/#Perl

All of these are recent 5.8.x builds.

Also check if you have environment veriables like $PERL5LIb, which is in effect when perl starts. It is like $PATH for your command, and determines where perl will look for it's modules.

From the information you posted, we cannot deduce what system you are on. What OS release, what architecture and so.
Choose wisely. If you are going to use DBD::Oracle on an Oracle-64bit, you will need a 64bit perl build. If you want to add XS modules, you need a build that was created with the same type of C-compiler that you have on your system: GNU gcc or HP C-ANSI-C).

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn