duplicates in @INC

K

Kien Ha

Hi,

perl -le 'print join "\n", @INC' shows me this:

/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
 
B

Ben Morrow

Kien Ha said:
perl -le 'print join "\n", @INC' shows me this:

/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
.

See the first 2 search paths and the last 2 ( before the . )
are duplicates and I want to remove the duplicates.

This doesn't matter.
Could someone tell me like:
What makes up the @INC ?

I'm not sure what you mean by this...
When and where the @INC is set ?

The default @INC is set when perl is built. If you want to change it,
you will have to rebuild perl.

Ben
 
K

Kien Ha

Ben said:
This doesn't matter.
True, but they just bother my eyes (personally :)
I'm not sure what you mean by this...
Sorry for not being clear.
Ok. When perl was built, it would use some kind of configuation
file (don't know which yet, will find out). I want to know
what config. settings were used for the @INC ? so that next
perl rebuild/build, I wouldn't have duplicates in @INC.
I know installarchlib installprivlib installsitelib are just
few of them, and what else ?
The default @INC is set when perl is built. If you want to change it,
you will have to rebuild perl.
Got it. So live with it or rebuild perl.

Thanks Ben
 
P

pkent

The default @INC is set when perl is built. If you want to change it,
you will have to rebuild perl.

....but you _can_ add to it or take from it at any time:

push @INC, '/home/system/cgi-bin/lib';
# at run-time

or:

use lib qw(./lib ../lib);
# at compile-time

And also use the PERL5LIB environment variable before invoking perl:

$ export PERL5LIB=/home/user/lib
$ perl foo.pl

P
 
E

Eric Amick

...but you _can_ add to it or take from it at any time:

push @INC, '/home/system/cgi-bin/lib';
# at run-time

or:

use lib qw(./lib ../lib);
# at compile-time

And use lib cleans out duplicates as a side effect, though it obviously
affects only the current run.
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top