LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   How is Perl's INC set? (http://www.linuxquestions.org/questions/linux-general-1/how-is-perls-inc-set-656417/)

cmnorton 07-17-2008 12:24 PM

How is Perl's INC set?
 
I have two Linux systems. One the RH 9 system, INC points to
/usr/lib/perl5/5.8.0/i386-linux-thread-multi

On my Kubuntu system, INC points to
/etc/perl

What initially sets INC?

What technique is preferred to modify it?

Su-Shee 07-17-2008 01:04 PM

Either perl itself during compilation or the package maintainer of your distribution who is setting it elsewhere.

You can put Perl stuff anywhere you want and add any directory to @INC, but you can't add "." while using the taint mode.

You can add the directory to PERL5LIB or
you can add use lib 'directory'; to your perl script or
you can push your directory onto @INC in a BEGIN block like

BEGIN { push @INC,"/home/you/yourperlstuff/";}


(Really depends on your personal preferences and what else do you want to do..

cmnorton 07-17-2008 01:21 PM

Thanks
 
This was a big help. Thanks.

karthik3152 06-06-2011 02:30 PM

PER5LIB usuage
 
you can use PERL5LIB or try to insert the line "use lib path"

For usage you can use the link
EDIT: Link removed


All times are GMT -5. The time now is 07:58 AM.