[sf-perl] @INC

Michael Budash mbudash at sonic.net
Wed Aug 16 12:37:34 PDT 2006


so...  where IS DBI.pm in your installation?

On Aug 16, 2006, at 12:26 PM, Loo, Peter # PHX wrote:

>
> Hi Michael and Michael,
>
> Still does not work.
>
> $ cat ./testCon.pl
> #!/usr/bin/perl -w
>
> use DBI;
>
> my $dbh = DBI->connect("dbi:Oracle:instance", "my_id", "my_pass", {
> RaiseError => 1 });
>
> $dbh->disconnect();
>
> exit;
>
> $ ./testCon.pl
> Can't locate DBI.pm in @INC (@INC contains:
> /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris
> /usr/local/lib/perl5/5.8.3/sun4-solaris /usr/local/lib/perl5/5.8.3
> /usr/local/lib/perl5/site_perl/5.8.3/sun4-solaris
> /usr/local/lib/perl5/site_perl/5.8.3 /usr/local/lib/perl5/site_perl .)
> at ./testCon.pl line 3.
> BEGIN failed--compilation aborted at ./testCon.pl line 3.
>
> $ env | grep PERL5LIB
> PERL5LIB=:/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris
>
> Peter
>
> -----Original Message-----
> From: sanfrancisco-pm-bounces 
> +peter.loo=source.wolterskluwer.com at pm.org
> [mailto:sanfrancisco-pm-bounces 
> +peter.loo=source.wolterskluwer.com at pm.or
> g] On Behalf Of Michael Friedman
> Sent: Wednesday, August 16, 2006 11:59 AM
> To: San Francisco Perl Mongers User Group
> Subject: Re: [sf-perl] @INC
>
> 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




More information about the SanFrancisco-pm mailing list