in reply to Why must LD_LIBRARY_PATH be defined outside script for DBD::Oracle?

Its a hack
  • Comment on Re: Why must LD_LIBRARY_PATH be defined outside script for DBD::Oracle?

Replies are listed 'Best First'.
Re^2: Why must LD_LIBRARY_PATH be defined outside script for DBD::Oracle?
by Anonymous Monk on Jul 26, 2019 at 02:14 UTC
      I'm well aware of the evils of LD_LIBRARY_PATH. But that was not my question, which was: why does Perl on Linux seem to require that LD_LIBRARY_PATH be defined before the script starts rather than being defined in a BEGIN block before DBD is loaded?

      P.S. If anyone can tell me how to do the equivalent of setting rpath in the .so files produced by AIX's xlc compiler, then I could go that route. But since I currently have to set LIBPATH for AIX (which I can set *inside* the script as opposed to prior to running the script like I have to do on Linux), then I'll stick to trying to set LD_LIBRARY_PATH on Linux.

        I'm well aware of the evils of LD_LIBRARY_PATH. But that was not my question, which was: why does Perl on Linux seem to require that LD_LIBRARY_PATH be defined before the script starts rather than being defined in a BEGIN block before DBD is loaded?

        But are you aware the that is how LD_LIBRARY_PATH works for all programs? That its not a perl variable?

        For every software Why? question, the answer is simple, because its written that way :)

        The LD in LD_LIBRARY_PATH stands for one of the few/many "ld.so" , there is no PERL_ prefix

        All docs I read about LD_LIBRARY_PATH mention its for testing/debugging...

        If that answers the question, then great :)

        P.S. If anyone can tell me how to do the equivalent of setting rpath in the .so files produced by AIX's xlc compiler, then I could go that route. But since I currently have to set LIBPATH for AIX (which I can set *inside* the script as opposed to prior to running the script like I have to do on Linux), then I'll stick to trying to set LD_LIBRARY_PATH on Linux.

        aix? :) Internet says instead of -Wl,--rpath use LIBPATH= or -Wl,-blibpath