Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to set LD_LIBRARY_PATH

by Khen1950fx (Canon)
on Jan 09, 2012 at 06:37 UTC ( #946948=note: print w/ replies, xml ) Need Help??


in reply to How to set LD_LIBRARY_PATH

I don't currently have Oracle installed, so this is untested.

#!/usr/bin/perl -l BEGIN { $ENV{ORACLE_HOME}=$ORACLE_HOME; $ENV{PATH}="$ORACLE_HOME/bin:$PATH"; $ENV{LD_LIBRARY_PATH}="$ORACLE_HOME/lib"; } use strict; use warnings; use DBD::Oracle; print "$DBD::Oracle::VERSION";


Comment on Re: How to set LD_LIBRARY_PATH
Download Code
Re^2: How to set LD_LIBRARY_PATH
by mbethke (Hermit) on Jan 09, 2012 at 07:17 UTC

    I can't think of anything to try this with right now but it's unlikely to work. Dynamically loaded modules use dlopen(3) to open libraries, whose Linux manpage says:

    o If, at the time that the program was started, the environment vari +able LD_LIBRARY_PATH was defined to contain a colon-separated list of d +irectories, then these are searched.

    Note the "at the time that the program was started" bit, which means the binary i.e. the Perl interpreter here.

Re^2: How to set LD_LIBRARY_PATH
by Khen1950fx (Canon) on Jan 09, 2012 at 07:41 UTC
    That's what I thought, too. But as I understand it now, it's unlikely to work if you set ENV after you load the modules, but it likely will work if set before you load the modules.

      but it likely will work if set before you load the modules.

      Won't, it has to be set before you run perl

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946948]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-12-26 14:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls