• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

Setting @INC on the command line

Hi,

I am running perl 5.8 on a HP-UX 11.i system.  When I do a perl -V on the command line I get the following error:

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.

What I am trying to figure out is why @INC is pointing at /opt/perl5.  This directory doesn't even exist.  Is there a way to change this (outside of setting it in an application each time)

0
sbhegel
Asked:
sbhegel
  • 7
  • 3
  • 3
  • +1
1 Solution
 
ps15Commented:
you can either use the command line -I switch or set the PERL5LIB environment variable
0
 
sbhegelAuthor Commented:
What is the command line -I switch?  

If I used the environment variable PERL5LIB what would I set that to?

Thanks
0
 
ozoCommented:
-I /opt/perl5
or
export PERL5LIB=/opt/perl5
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
ps15Commented:
> If I used the environment variable PERL5LIB what would I set that to?

Well you'd need to fine out where perl is installed on your system, and set it to the proper lib directory
0
 
sbhegelAuthor Commented:
ps15,

When I set PERL5LIB in my /etc/profile to:
export PERL5LIB=/opt/perl/lib

I still get the same result.
0
 
TintinCommented:
Did you upgrade Perl?

Perhaps the perl 5.8.0 binary is in a different location to the perl 5.002 binary?

Do a

find / -name perl

to find all your perl versions.
0
 
sbhegelAuthor Commented:
The only places I have perl is:

/opt/perl
/opt/perl/html/perl
/opt/perl/bin/perl
/opt/hpws/apache/lib/perl
/opt/ldapux/contrib/bin/perl
/usr/contrib/bin/perl
/usr/contrib/Q4/bin/perl
/var/adm/sw/products/perl
/var/adm/sw/save/PHCO_29995/Q4/usr/contrib/Q4/bin/perl

if I do a whereis perl I get:
/usr/contrib/bin/perl /opt/perl/bin/perl /opt/perl/man/man1/perl.1


If I do a /opt/perl/bin/perl -V  I get all the correct info I am looking for.  

I have not upgraded this install of perl.  It came already installed on the server when we got it.

0
 
ozoCommented:
find /opt /usr/contrib/ /var/adm/sw/ -name Config.pm
0
 
sbhegelAuthor Commented:
Here are the results:

/opt/perl/lib/5.8.0/Net/Config.pm
/opt/perl/lib/5.8.0/PA-RISC1.1-thread-multi/Config.pm
/opt/perl/lib/5.8.0/PA-RISC1.1-thread-multi/Encode/Config.pm
/opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/Tk/Config.pm
/opt/perl/lib/site_perl/5.8.0/PPM/Config.pm

0
 
ps15Commented:
then try setting the env variable to /opt/perl/lib/5.8.0/
0
 
sbhegelAuthor Commented:
I already tried that and get the same results.

How is @INC set?  Is this in a file someplace?
0
 
TintinCommented:
What is the result of:

find / -name perl -type f -exec {} -v \; -print
0
 
sbhegelAuthor Commented:
A bunch of stuff:

This is perl, v5.8.0 built for PA-RISC1.1-thread-multi
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2002, Larry Wall

Binary build 806 provided by ActiveState Corp. http://www.ActiveState.com
Built 21:44:05 May  2 2003


Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

/opt/perl/bin/perl

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

Copyright 1987-1998, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

/opt/ldapux/contrib/bin/perl

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

Copyright 1987-1998, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

/usr/contrib/bin/perl

This is perl, v5.6.1 built for PA-RISC1.1-thread-multi
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2001, Larry Wall

Binary build 627 provided by ActiveState Tool Corp. http://www.ActiveState.com
Built 21:42:53 Jun 20 2001


Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

/usr/contrib/Q4/bin/perl
/var/adm/sw/save/PHCO_29995/Q4/usr/contrib/Q4/bin/perl

This is perl, v5.6.1 built for PA-RISC2.0-64all

Copyright 1987-2001, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

/vendor/software/desktop28/HP-UX/bin/perl

This is perl, v5.6.1 built for PA-RISC2.0-64all

Copyright 1987-2001, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

/vendor/software/desktop/HP-UX/bin/perl

This is perl, version 5.001

      Unofficial patchlevel 1m.

Copyright 1987-1994, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.
/vendor/iplanet/servers/bin/https/perl/perl

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

Copyright 1987-1999, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

/vendor/iplanet/servers/plugins/chilisoft/package/HP-UX/bin/perl

This is perl, v5.6.1 built for PA-RISC2.0-64all

Copyright 1987-2001, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.

/vendor/tomcat/webapps/qadui/WEB-INF/cgi/desktop/bin/perl
0
 
ozoCommented:
It looks like you want to be running /opt/perl/bin/perl instead of /usr/contrib/bin/perl
what is your $PATH
0
 
TintinCommented:
Wow.  That's a lot of different Perl versions on your system.

OK, the problem is with your PATH as you have /usr/contrib/bin in the PATH before /opt/perl/bin

Either change the order of your PATH so that it has /opt/perl/bin *before* /usr/contrib/bin

or call the Perl 5.8.0 with the full path, ie:

/opt/perl/bin/perl
0
 
sbhegelAuthor Commented:
Ok,

I modified /etc/PATH to have /opt/perl/bin before the /usr/contrib/bin and then it works out.

Thanks for all your help.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 7
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now