Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • the libs use the env value as they see it when they start up. so if you set %ENV before you load the other libs it should work fine:

    BEGIN {
          $ENV{LD_LIBRARY_PATH} = 'path_to_lib' ;

    use FooLib ;

    • Based on what I was seeing yesterday, that is not correct. does not load at compilation time. All I do is use DBI. If I understand correctly, DBD::Oracle is not loaded until I say DBI->connect("dbi:Oracle...").

      But just in case I was misunderstanding, I tried what you are suggesting, two ways: by putting the setting of LD_LIBRARY_PATH in a BEGIN block, as you suggested, and also by throwing 'use DBI' into a string eval, just for good measure, to make certain that the load must occur after the variable is changed.

      I found reference to this issue online, including a statement by somebody that he'd seen docs saying to set LD_LIBRARY_PATH in a BEGIN block but that it "didn't seem to work anymore" and he wanted to know what changed.

      The real answer is that should be compiled to know where to look for the libraries it is linked to. But no amount of mucking with -R and LD_RUN_PATH has seemed to have helped me so far. I suppose I should try directly compiling my own from the command-line and seeing if it works, because so far all I've tried is setting these via options to Makefile.PL.

      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers