I have to add /oracle/v10.2.0/lib to LD_LIBRARY_PATH to use DBI module to connect to Oracle.
If I set LD_LIBRARY_PATH in shell before executing perl script, everything is ok.
But it does not work from script:
BEGIN {
$ENV{'LD_LIBRARY_PATH'}='/oracle/v10.2.0/lib';
}
use DBI;
When I execute the script I get the error:
install_driver(Oracle) failed: Can't load '/usr/apps/perl5/site_perl/5.8.8/i686-linux/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such file or directory at /usr/apps/perl5/5.8.8/i686-linux/DynaLoader.pm line 230. at (eval 3) line 3 Compilation failed in require at (eval 3) line 3. Perhaps a required shared library or dll isn't installed where expected at /var/tmp/getTraceDB.pl line 23