Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Perl libraries and @INC

Jimmy Rogers
Frequent Advisor

Perl libraries and @INC

OK, I have Perl 5.6.1 installed on an 11.11 server:
swlist | grep -i perl
perl B.5.6.1.F Perl Programming Language

But it fails a perl -V:
perl -V
Can't locate Config.pm in @INC (@INC contains: /opt/perl5/lib/5.00502/PA-RISC1.1 /opt/perl5/lib/5.00502 /opt/perl5/lib/site_perl/5.005/PA-RISC1.1 /opt/perl5/lib/site_perl/5.005 .).
BEGIN failed--compilation aborted.

I do have Config.pm, but @INC is pointed wrong:
/opt/perl/lib/site_perl/5.6.1/PPM/Config.pm
/opt/perl/lib/site_perl/5.6.1/PA-RISC1.1-thread-multi/Tk/Config.pm
/opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi/Config.pm

perl -help says I can add paths to the @INC entries with perl -Idirectory #

But anytime I do the following:
perl -I/opt/perl/lib/site_perl/5.6.1/PPM
perl -I/opt/perl/lib/site_perl/5.6.1/PA-RISC1.1-thread-multi/Tk
perl -I/opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi

All it does is hang. I even inserted a space between the -I and the paths, still just hangs there. I figure I must be doing a parameter wrong, but after searching the 'Net for examples, the -I option is just listed as -Idirectory with no examples. What am I doing wrong?
3 REPLIES
Craig A Berry
Honored Contributor

Re: Perl libraries and @INC

Jimmy,

You've got a couple of problems here. The first one is that this is an OpenVMS forum and you appear to be running Perl on HP-UX (at least that's what I assume 11.11 means).

Another problem is that your @INC appears to be sending Perl off into directories with 5.00502 in their names, i.e., your library paths are set to a much older version of Perl. Those directories may no longer exist or may have incompatible library versions with your newer (though still far from current) 5.6.1 Perl. Check the value of the environment variable PERL5LIB -- that may well be set to something for 5.005_02.

The -I directive only modifies @INC for the current run of Perl. It is not, as you appear to be thinking, something that reconfigures the default values of @INC. The reason it "hangs" is that it is waiting for you to enter a script on standard input since you did not specify one on the command line.

I recommend sending mail to beginners-subscribe AT perl DOT org and you will then be part of a forum much better suited to handling this sort of issue.
Jimmy Rogers
Frequent Advisor

Re: Perl libraries and @INC

Oops thought I was in the HP forums, sorry!
Martin P.J. Zinser
Honored Contributor

Re: Perl libraries and @INC

Hello Jimmy,

well you are in the hp forums, but hp is more than hp-ux. Have a look at

http://forums1.itrc.hp.com/service/forums/categoryhome.do?categoryId=150

for the ux crowd.

Nevertheless Craig already pointed out the likely problem.

One more hint, the path you most probably need is /opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi

There is more than one Config.pm and they do not all contain the same stuff and are interchangeable;-)

All the best,

Martin