I have a module (specifically, DBD::Oracle) failing to load because the Oracle library (specifically, libclntsh.so.1.0) is not where it expects to find it. Ordinarily, I would simply set LD_LIBRARY_PATH to include the non-standard directory where this library exists, and all would be well. However, changes to this variable within my Perl script (even within a BEGIN block) fail to make any difference at all to the actual search path used by Perl, and
this library search doesn't seem to be subject to something controllable like @dl_search_path in DynaLoader (presumably because it's the Oracle.so trying to load the .so, not the Perl module). If I set LD_LIBRARY_PATH variable
outside of the Perl script, and then execute it, everything works as it should.
Is there any reason why loading shared libraries would honor an environment variable set before execution of the script as opposed to being set after the script starts executing but before the request for the shared library occurs? Is there any easy way of fixing this in the module that wouldn't involve something at the system-level? The solution I'll end up going with is modifying the user profile to include this Oracle lib directory in LD_LIBRARY_PATH, but I'm wondering why setting this environment variable within Perl would have no effect on the actual library path used.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.