dbaad has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
When I run a script from shell using DBI and I have LIBPATH set to something other than when DBI was compiled, I get a install_driver(oracle) error and the script dies.
$dbh = DBI->connect(dbi:Oracle:etc.....)
unsetting LIBPATH always works. The problem is I want to trap this error so the script doesn't die if someone executes it with the wrong LIBPATH. The only way I have found to do this is the expensive operation of calling
my @drivers = DBI->installed_versions;
and then check to see if Oracle is there before I DBI->connect.
Additionally, since the linkers cache the LIBPATH value before the script even executes (from what i understand), i can't unsetLIBPATH in a BEGIN block either.
Does anyone have a suggestion as to how I can deal with this other than using DBI->installed_versions ?
Editted by BazB: fixed formatting/code tags.
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI problems.
by astroboy (Chaplain) on Feb 28, 2004 at 09:12 UTC | |
by dbaad (Initiate) on Feb 28, 2004 at 21:14 UTC | |
by astroboy (Chaplain) on Mar 01, 2004 at 10:29 UTC | |
|
Re: DBI problems.
by esskar (Deacon) on Feb 28, 2004 at 02:48 UTC |