473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

@INC is not what I expect

niz
I have this perl script running on solaris in korn:

$ cat scriptb.sh
#!/usr/bin/perl
use strict;
use DBI;

these are my included library directories:

$ perl -e "print join(\"\n\", @INC);"
/opt/arbor/arborvbs/klaunchdir/klaunch_3.1
/opt/arbor/arborvbs/scriptdir/bin
/opt/arbor/arborvbs/arbor3p/arborperl56/lib/5.6.0/sun4-solaris
/opt/arbor/arborvbs/arbor3p/arborperl56/lib/5.6.0
/opt/arbor/arborvbs/arbor3p/arborperl56/lib/site_perl/5.6.0/sun4-solaris
/opt/arbor/arborvbs/arbor3p/arborperl56/lib/site_perl/5.6.0
/opt/arbor/arborvbs/arbor3p/arborperl56/lib/site_perl
..

but when i run the script:

$ scriptb.sh
Can't locate DBI.pm in @INC (@INC contains:
/opt/arbor/arborvbs/klaunchdir/klaunch_3.1
/opt/arbor/arborvbs/scriptdir/bin /usr/perl5/5.00503/sun4-solaris
/usr/perl5/5.00503 /usr/perl5/site_perl/5.005/sun4-solaris
/usr/perl5/site_perl/5.005 .) at ./scriptb.sh line 3.
BEGIN failed--compilation aborted at ./scriptb.sh line 3.
$

as you can see the scripts @INC list is completely different from what
i expect, and so it can't find DBI.pm.

any explanations? how is it getting that strange @INC list?
Jul 19 '05 #1
2 2619
In article <fc**************************@posting.google.com >, niz wrote:
I have this perl script running on solaris in korn:
I don't think perl cares about your shell environment.
$ cat scriptb.sh
#!/usr/bin/perl
use strict;
use DBI;

these are my included library directories:

$ perl -e "print join(\"\n\", @INC);"
Ah! only perl. Not /usr/bin/perl ...

[snip]
/opt/arbor/arborvbs/arbor3p/arborperl56/lib/5.6.0/sun4-solaris
/opt/arbor/arborvbs/arbor3p/arborperl56/lib/5.6.0
/opt/arbor/arborvbs/arbor3p/arborperl56/lib/site_perl/5.6.0/sun4-solaris
/opt/arbor/arborvbs/arbor3p/arborperl56/lib/site_perl/5.6.0
/opt/arbor/arborvbs/arbor3p/arborperl56/lib/site_perl
This makes me assume you have two different perl interpreters installed.
Could you try the same with /usr/bin/perl instead of perl only?

[snip]
any explanations? how is it getting that strange @INC list?


That's the only idea I that comes to my mind ATM.

André

--
Every cloud engenders not a storm.
-- William Shakespeare, "Henry VI"
Jul 19 '05 #2


niz wrote:
I have this perl script running on solaris in korn:

$ cat scriptb.sh
#!/usr/bin/perl $ perl -e "print join(\"\n\", @INC);" the scripts @INC list is completely different from what
i expect, and so it can't find DBI.pm.

any explanations? how is it getting that strange @INC list?


You've got two versions of perl installed.

Your script is pointing at an install of perl 5.005 and your command
line is seeing perl 5.6.0. You need to update the first line of your
script to point to 5.6.0 instead.

At a command line type "which perl" to get the location of the other
perl binary, and use this location as the first line of your script,
then you should be good to go.

TTFN

Simon.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Phester | last post by:
If a file has a .inc extension, or if it has a .inc.php extension, is it treated differently by the php interpreter? Or is it just a convention? I've been calling my included files filename.php...
5
by: vishal | last post by:
hello vishal here. i have seen some scripts which includes file like include('time.inc') so can anyone tell me what this file contain. and what is extension
1
by: Passero | last post by:
I have a rather big project written in ASP 3.0. It has more dan 200 pages and i have 4 inc-files with general functions that are used in almost al the pages. When an error occures, i get a mail...
14
by: rogerclive | last post by:
Perhaps, there is no bigger sleazy company in the entire Maple Republic ( Canada ) than Matrox Graphics Inc. I paid $100+ through my nose circa 1999 for Matrox Millenium II and Mystique. It...
9
by: bettina | last post by:
I have the following piece of code (symplified) require("lang.{$lang}.inc.php"); // I include the inc. files .... function decodify($technique) { // functions that give me back the value in...
4
by: IchBin | last post by:
What are the advantages or disadvantages of .inc files over the 'include' statement. I can't seem to find that information at the PHP website. Also the same for form building inline, I guess you...
2
by: kwr2k | last post by:
Hi, I am trying to install Expect.pm on HP-UX. I get the following error: ------------------------------------------------------------------- $ perl Makefile.PL...
6
by: goodguyjam | last post by:
Hi all, I'm having trouble with mysql. I've just finished my php coding for HTTP authentication and with some help am now getting a login window pop up whenever I click on a link on my website...
1
by: Graham1234 | last post by:
Hi, I've just upgraded perl from 5.8.8 to 5.10.0 I have lots of scripts that use various perl modules and libraries. Now when I run them, they can't find them. For example I get: Can't locate...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.