[sf-perl] @INC

Michael Friedman friedman at highwire.stanford.edu
Wed Aug 16 12:53:11 PDT 2006


Uh, you're trying to use 5.6.1 modules with 5.8.3? That *should*  
work, but I haven't tried it.

Well, in any case, it properly added the PERL5LIB value to @INC, as  
you can see from the error
> Can't locate DBI.pm in @INC (@INC contains:
> /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris

so it's not the @INC path that is the problem here.

Did you check permissions?
Everything in sun4-solaris (or any systemname dir) has a compiled  
component, perhaps DBI needs to be recompiled for a new machine or os?

I'm assuming there's a reason you don't just install DBI in your  
5.8.3 installation, but that would be the easiest solution. ;-)

-- Mike

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

>
> 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.
> _______________________________________________
> 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