[sf-perl] @INC

Michael Friedman friedman at highwire.stanford.edu
Wed Aug 16 11:58:32 PDT 2006


At my office, we store our code in CVS, so each developer has their  
own copy of our custom modules. To make that work we couldn't use  
'use lib' because we didn't want to edit the files everytime. Instead  
we use PERL5LIB, the environment variable.

Perl adds any dirs in PERL5LIB into your @INC before running any  
script. (See `man perlrun`.)

However, as the perlrun page points out, this is inherently insecure,  
so don't try it if you are checking for taint, running on a shared  
machine, etc. etc.

-- Mike

PS - You can also unshift dirs directly onto @INC, but that's the  
brute force approach.

On Aug 16, 2006, at 11:47 AM, Michael Budash wrote:

>        use lib '/path/to/the/modules';
>
> is the preferable way to do this
>
> On Aug 16, 2006, at 11:35 AM, Loo, Peter # PHX wrote:
>
>> Hi All,
>>
>> Will someone please tell me how I can add the Perl Modules in @INC
>> so that I can reference the using use statement?
>>
>> Thanks.
>>
>> Peter
>> _______________________________________________
>> SanFrancisco-pm mailing list
>> SanFrancisco-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>
> --
> Michael Budash
> Michael Budash Consulting
> michael at budashconsulting.com
> 707-252-7670 off
> 707-363-4262 cel
>
>
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm

---------------------------------------------------------------------
Michael Friedman                     HighWire Press
Phone: 650-725-1974                  Stanford University
FAX:   270-721-8034                  <friedman at highwire.stanford.edu>
---------------------------------------------------------------------




More information about the SanFrancisco-pm mailing list