[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Setting @INC on the command line

Posted on 2006-05-03
16
Medium Priority
?
503 Views
Last Modified: 2012-05-05
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
Comment
Question by:sbhegel
  • 7
  • 3
  • 3
  • +1
16 Comments
 
LVL 4

Expert Comment

by:ps15
ID: 16600646
you can either use the command line -I switch or set the PERL5LIB environment variable
0
 

Author Comment

by:sbhegel
ID: 16600666
What is the command line -I switch?  

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

Thanks
0
 
LVL 85

Expert Comment

by:ozo
ID: 16600673
-I /opt/perl5
or
export PERL5LIB=/opt/perl5
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:ps15
ID: 16600682
> 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
 

Author Comment

by:sbhegel
ID: 16600718
ps15,

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

I still get the same result.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 16600846
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
 

Author Comment

by:sbhegel
ID: 16600879
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
 
LVL 85

Expert Comment

by:ozo
ID: 16600939
find /opt /usr/contrib/ /var/adm/sw/ -name Config.pm
0
 

Author Comment

by:sbhegel
ID: 16600954
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
 
LVL 4

Expert Comment

by:ps15
ID: 16600966
then try setting the env variable to /opt/perl/lib/5.8.0/
0
 

Author Comment

by:sbhegel
ID: 16600991
I already tried that and get the same results.

How is @INC set?  Is this in a file someplace?
0
 
LVL 48

Expert Comment

by:Tintin
ID: 16601019
What is the result of:

find / -name perl -type f -exec {} -v \; -print
0
 

Author Comment

by:sbhegel
ID: 16601046
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
 
LVL 85

Expert Comment

by:ozo
ID: 16601078
It looks like you want to be running /opt/perl/bin/perl instead of /usr/contrib/bin/perl
what is your $PATH
0
 
LVL 48

Accepted Solution

by:
Tintin earned 2000 total points
ID: 16601086
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
 

Author Comment

by:sbhegel
ID: 16601147
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question