I think changes to SHLIB_PATH (like LD_LIBRARY_PATH) don't affect
the running process. Someone posted an example some weeks ago that
sets the end var then re-executes the script - that would work.
Tim.
On Fri, Jun 06, 2003 at 02:43:13PM +0200, Wolf, Dr. Stefan wrote:
> Hi,
> i have a oracle database in a clustered environment (mc/sg on hpux) with
> locally installed oracle driver. To connect to a database, i have to set and
> export variables (mainly SHLIB_PATH to point to the local libraries) in a
> shell script, then call the perl script. When i try setting the env
> variables inside a begin block, this seems to work, variables are set
> correctly. But the database connection fails! Probably the oracle driver is
> loaded befor the begin block is compiled and run. Any suggestions how to
> solve this? Some lines from the script are shown below.
> Regards,
> S. Wolf
>
>
> BEGIN
> {
> $ENV{'ORACLE_BASE'}="/oracle/CLIENT" unless $ENV{'ORACLE_BASE'};
> $ENV{'ORACLE_HOME'}="$ENV{'ORACLE_BASE'}/product/8.1.7" unless
> $ENV{'ORACLE_HOME'};
> $ENV{'SHLIB_PATH'}="$ENV{'ORACLE_HOME'}/lib" unless $ENV{'SHLIB_PATH'};
> }
>
> use strict;
> use DBI;
>
> .........
>
> # establish database handler, connect to database
> my $dbh = DBI->connect("DBI:Oracle:$dbname", $dbuser, $dbpassword)
> || die "Unable to connect to $dbname:
> $DBI::errstr\n";