in reply to RE: Re: DBI, DBD::Oracle and LD_LIBRARY_PATH
in thread DBI, DBD::Oracle and LD_LIBRARY_PATH

I ran into this problem recently on Linux. (I think it was triggered by an update of the Oracle InstantClient package; it used to run okay with caring about LD_LIBRARY_PATH. I'm not certain of that, though.)

I ended up using the solution above, but changing the first condition from

  unless ($ENV{BEGIN_BLOCK}) {

to

  unless (($ENV{BEGIN_BLOCK}) or $^C) {

so that my habitual "perl -c script.pl" reflexes would work. Without that change, the BEGIN block will re-execute the script in fully-operational mode, which is almost certainly not what you want.

(Of course, in versions of Perl that have it - certainly 5.6.0 onward, maybe later revisions of 5.005 - you should just use an INIT block instead. But that wasn't an option when the question was originally asked.)

Replies are listed 'Best First'.
Re^4: DBI, DBD::Oracle and LD_LIBRARY_PATH
by Anonymous Monk on Feb 24, 2009 at 16:11 UTC
    or simply give perl the library in the location where it looks for it. Silly but easy (if you are root). ln -s $ORACLE_HOME/libnnz10.so /usr/lib/libnnz10.so
      Yes, it's an old thread, but the problem still occurs.

      Under Solaris 10, one can add the default search-path using crle:

      root> crle -u -l /youroracledir/lib/instantclient_11_2
      There are a lot of options available (32/64bit, etc.), so it's worth to study the docs before copy/pasting any example given here ;-)