jrw has asked for the wisdom of the Perl Monks concerning the following question:
whereas exporting LD_LIBRARY_PATH *before* running perl -e allows the script to succeed. Does DynaLoader cache the initial LD_LIBRARY_PATH during script startup? Or is something else going on? Test script:install_driver(Oracle) failed: Can't load '/home/jrw/perl_dbi/linux/li +b/perl5/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for modu +le DBD::Oracle: libclntsh.so.18.1: cannot open shared object file: No + such file or directory at /usr/lib64/perl5/DynaLoader.pm line 200. at (eval 38) line 3
export DIR=/home/jrw/perl_dbi/linux unset LD_LIBRARY_PATH # export LD_LIBRARY_PATH=$DIR/oracle_instantclient perl -e ' use strict; use warnings; BEGIN { $ENV{LD_LIBRARY_PATH} = "$ENV{DIR}/oracle_instantclient" } use lib "$ENV{DIR}/lib/perl5"; use DBI; my @drivers = DBI->available_drivers; print "Drivers = @drivers\n"; foreach my $driver (@drivers) { my @databases = DBI->data_sources($driver); print " Driver: $driver, data sources = @databases\n"; } '
|
|---|