Newbie question on use

B

Beable van Polasm

chatiman said:
Hello again,

If i have 2 modules :

print("in package A, INC = @INC\n");

print("in package B, INC = @INC\n");

Get the computer to tell you.


--
 
J

John W. Kennedy

Anno said:
What is the "package B search"?

Never mind, you decide, and when it happens, print @INC.

That doesn't tell whether it's defined behavior, you know.

--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
-- Charles Williams. "Judgement at Chelmsford"
 
J

Jimi-Carlo Bukowski-Wills

Since @INC is global, you should see /path in @INC in any script using
module A directly or indirectly. I've tested it and it works:
package A;

-------------------------
package A;
use lib "/path";
--------------------------
package B;
use A;
--------------------------
$ perl B.pl
/path
/usr/lib/perl5/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/5.8.1
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.1
.....

Jimi
 
M

Malcolm Dew-Jones

Jimi-Carlo Bukowski-Wills ([email protected]) wrote:
: Since @INC is global, you should see /path in @INC in any script using
: module A directly or indirectly.

assuming you haven't local'ized @INC.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top