Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > @INC is not what I expect

Reply
Thread Tools

@INC is not what I expect

 
 
niz
Guest
Posts: n/a
 
      07-23-2003
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?
 
Reply With Quote
 
 
 
 
Andre Bonhote
Guest
Posts: n/a
 
      07-23-2003
In article <(E-Mail Removed) >, 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"
 
Reply With Quote
 
 
 
 
Simon Andrews
Guest
Posts: n/a
 
      07-23-2003


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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to expect eof with expect+pty Simon Strandgaard Ruby 4 12-20-2006 04:00 PM
Bug in $obj->expect() ... ? (Expect 1.15) Phil Perl Misc 0 07-07-2006 07:25 AM
tkinter: not freeing memory like I'd expect Benjamin Rutt Python 0 03-30-2006 07:56 PM
Abstract Class Extenstions Not exactly working as I would expect. Michael Boocher via JavaKB.com Java 8 05-30-2005 03:25 PM
compile time comparison 1.2ghz vs 2.5ghz -- not what you might expect TR ASP .Net 1 12-14-2004 06:02 PM



Advertisments