On Wed, Apr 16, 2014 at 8:15 AM, H.Merijn Brand <h.m.br...@xs4all.nl> wrote: > On Wed, 16 Apr 2014 17:06:19 +0200, "H.Merijn Brand" > <h.m.br...@xs4all.nl> wrote: > >> if I change Oracle.pm to start with >> --8<--- >> BEGIN { >> use Config; >> (my $loc = $INC{"DBD/Oracle.pm"}) =~ >> s{/DBD/Oracle.pm$}{/$Config{archname}/auto/DBD/Oracle}; >> $ENV{LD_LIBRARY_PATH} = "$oloc:$ENV{LD_LIBRARY_PATH}"; >> $ENV{SHLIB_PATH} = "$oloc:$ENV{SHLIB_PATH}"; >> } >> -->8--- >> >> I am still too late :( :(
I believe all the LD_* variables are only read once during process startup. Setting them within the app will only affect any child process started afterwards, but not change the behavior of the dynamic loader inside the current process. It's been probably 15 years ago, but for a similar problem with DBD::Oracle on HP-UX back then we used a wrapper app that set LD_PRELOAD to request specific libraries to be loaded, and then exec'ed perl from that wrapper: ld_preload = (char *)malloc(strlen(libjava) + strlen(libcl) + strlen(libclnt) + 13); sprintf(ld_preload, "LD_PRELOAD=%s:%s:%s", libjava, libcl, libclnt); putenv(strdup(ld_preload)); argv[0] = me; execvp(argv[0], argv); Cheers, -Jan