[sf-perl] @INC

Loo, Peter # PHX Peter.Loo at source.wolterskluwer.com
Wed Aug 16 12:39:32 PDT 2006


aztec::/export/home/ip00846/bin/perl>$ find / -name DBI.pm -print
2>/dev/null
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Bundle/DBI.pm
/opt/app/oracle/product/10.1/perl/lib/site_perl/5.6.1/Apache/DBI.pm
/opt/app/oracle/product/10.1/perl/lib/site_perl/5.6.1/sun4-solaris/Bundl
e/DBI.pm
/opt/app/oracle/product/10.1/perl/lib/site_perl/5.6.1/sun4-solaris/DBI.p
m
/opt/app/oracle/product/appsvr/ows/cartx/common/perl/lib/site_perl/DBI.p
m
/export/home/itssbs1/DBI-1.06/lib/Bundle/DBI.pm
/export/home/itssbs1/DBI-1.06/DBI.pm
/export/home/itssbs1/DBI-1.06/blib/lib/Bundle/DBI.pm
/export/home/itssbs1/DBI-1.06/blib/lib/DBI.pm
/export/home/itssta2/DBI-1.20/lib/Bundle/DBI.pm
/export/home/itssta2/DBI-1.20/DBI.pm
/export/home/itssta2/DBI-1.20/blib/lib/DBI.pm
/export/home/itssta2/DBI-1.20/blib/lib/Bundle/DBI.pm
/.cpan/build/DBI-1.45/lib/Bundle/DBI.pm
/.cpan/build/DBI-1.45/DBI.pm
/.cpan/build/DBI-1.45/blib/lib/DBI.pm
/.cpan/build/DBI-1.45/blib/lib/Bundle/DBI.pm
 
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 Budash
Sent: Wednesday, August 16, 2006 12:38 PM
To: San Francisco Perl Mongers User Group
Subject: Re: [sf-perl] @INC

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


_______________________________________________
SanFrancisco-pm mailing list
SanFrancisco-pm at pm.org
http://mail.pm.org/mailman/listinfo/sanfrancisco-pm


This E-mail message is for the sole use of the intended recipient(s) and
may contain confidential and privileged information.  Any unauthorized
review, use, disclosure or distribution is prohibited.  If you are not
the intended recipient, please contact the sender by reply E-mail, and
destroy all copies of the original message.


More information about the SanFrancisco-pm mailing list