Home > Archive > PERL Beginners > July 2005 > Adding a library to @INC
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Adding a library to @INC
|
|
| Jay Caviness 2005-07-27, 5:02 pm |
| I have discovered that my Oracle installation has the DBI.pm module in
it. I really want to use this, but don't know how to have the @INC see
it when I do:
oracle> perl -e "use DBI;"
Can't locate DBI.pm in @INC (@INC contains:
/usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib
/usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1
/usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int
/usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
--
Thanks,
Jay
| |
| Wiggins d'Anconia 2005-07-27, 5:02 pm |
| Jay Caviness wrote:
> I have discovered that my Oracle installation has the DBI.pm module in
> it. I really want to use this, but don't know how to have the @INC see
> it when I do:
>
> oracle> perl -e "use DBI;"
>
> Can't locate DBI.pm in @INC (@INC contains:
> /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib
> /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1
> /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int
> /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at -e line 1.
> BEGIN failed--compilation aborted at -e line 1.
>
Normally you add to the @INC using the PERL5LIB environment variable. If
"oracle>" represents a normal bash shell, then,
export PERL5LIB="/path/to/lib/dir"
Should do the trick. If it is actually the Oracle client then you might
try the same because *theoretically* the subprocess should inherit and
respect the same environment.
HTH,
http://danconia.org
| |
| Stephen Mayer 2005-07-27, 5:02 pm |
| -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jay,
You need to set the PERL5LIB path to include the directory of the DBI.pm module.
Steve
Jay Caviness wrote:
> I have discovered that my Oracle installation has the DBI.pm module in
> it. I really want to use this, but don't know how to have the @INC see
> it when I do:
>
> oracle> perl -e "use DBI;"
>
> Can't locate DBI.pm in @INC (@INC contains:
> /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib
> /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1
> /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int
> /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at -e line 1.
> BEGIN failed--compilation aborted at -e line 1.
>
- --
========================================
===========================
Steve Mayer Oracle Corporation
Principal Member of Technical Staff Portland Development Center
Oracle Collaboration Suite 1211 SW 5th Ave.
Stephen.Mayer@oracle.com Suite 900
Phone: 503-525-3127 Portland, OR 97204
========================================
===========================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQFC59s3C4cakfkZLXQRAvPCAJ4wxT5cyeXF
gi6yDZWl0izoEKy/AACfRjfo
RXDFR1mWV1h7/FURBAzBSrg=
=lnWU
-----END PGP SIGNATURE-----
| |
| Tom Allison 2005-07-28, 9:07 am |
| Wiggins d'Anconia wrote:
> Normally you add to the @INC using the PERL5LIB environment variable. If
> "oracle>" represents a normal bash shell, then,
>
> export PERL5LIB="/path/to/lib/dir"
>
> Should do the trick. If it is actually the Oracle client then you might
> try the same because *theoretically* the subprocess should inherit and
> respect the same environment.
>
I'm trying to do the same under a Solaris install at work and for some
reason that I can't find ( insufficient man pages on box ), I can't get
my Environment of ~/.profile to be recognized from crontab entries.
Any other options under Solaris that I should try?
I know, I'm on the OT fringe here, maybe someone can give me an answer
using perl -i ?? :)
| |
| Xavier Noria 2005-07-28, 9:07 am |
|
On Jul 28, 2005, at 12:32, Tom Allison wrote:
> Wiggins d'Anconia wrote:
>
>
>
> I'm trying to do the same under a Solaris install at work and for
> some reason that I can't find ( insufficient man pages on box ), I
> can't get my Environment of ~/.profile to be recognized from
> crontab entries.
>
> Any other options under Solaris that I should try?
Sure, perldoc lib.
-- fxn
| |
| Wiggins d'Anconia 2005-07-28, 9:59 pm |
| Tom Allison wrote:
> Wiggins d'Anconia wrote:
>
>
> I'm trying to do the same under a Solaris install at work and for some
> reason that I can't find ( insufficient man pages on box ), I can't get
> my Environment of ~/.profile to be recognized from crontab entries.
>
> Any other options under Solaris that I should try?
>
> I know, I'm on the OT fringe here, maybe someone can give me an answer
> using perl -i ?? :)
>
I ran into the same problem. In general to my knowledge cron for
security reasons uses what is essentially an empty environment subshell,
and won't source any profiles. I know we accomplished the same task, but
don't have specifics. Try adding an export of the environment to the
beginning of your crontab command line, and separate it with semi-colons
as if you were issuing a single command, similar to,
* * * * * export PERL5LIB=/path/to/dir; /run/your/command
See if that works. I know it is possible with Solaris' cron but I know
we had to mess with it for a while. If you have compiled modules with a
C component you may also have to mess with the LD_* environment
variables, we had to.
HTH,
http://danconia.org
|
|
|
|
|