Option 1:
Before any use of DBI/DBD,
BEGIN { $ENV{ORACLE_HOME} = "..."; $ENV{LD_LIBRARY_PATH} = "..."; }
I think I heard this doesn't work. Something about a clone of the environment getting creating by the C runtime library before this, and this is what Oracle uses?
Option 2:
Set the environment before calling Perl.
ORACLE_HOME=... LD_LIBRARY_PATH=... perl ...
You could use a loader script for this.
Option 3:
Make the Perl script itself the loader script.
BEGIN { my $oracle_home = "..."; my $ld_library_path = "..."; if ($ENV{ORACLE_HOME} ne $oracle_home || $ENV{LD_LIBRARY_PATH} ne $ld_library_path ) { $ENV{ORACLE_HOME} = "..."; $ENV{LD_LIBRARY_PATH} = "..."; exec { $^X } $^X, $0, @ARGV; } }
In reply to Re: setting environment variable issue
by ikegami
in thread setting environment variable issue
by Samy_rio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |