On 11 Jan 2003 22:15:08 +0100 Kristian Nielsen <[EMAIL PROTECTED]> wrote:
> Michael A Chase <[EMAIL PROTECTED]> writes:
>
> > I've been pondering this and the best I can come up with is to build
> > DBD::Oracle twice into separate directories using PREFIX= as an option
> > (e.g., 'perl Makefile.PL PREFIX=/app/DBD-Oracle/8i'). Then adjust
> > $PERL5LIB before starting your script so the appropriate version of
> > DBD::Oracle is in @INC. Note that neither version gets installed in
> > the normal location.
>
> Not sure if it is relevant here, but I would just mention that using a
> BEGIN {} block this can be done from within the script, without the need
> to fiddle with PERL5LIB outside the script, a technique I have
> previously found useful. For example (untested):
>
> -----------------------------------------------------------------------
> #! /usr/bin/perl -w
>
> my $DBDLIB;
> BEGIN {
> if(grep /^-8i$/, @ARGV) {
> $DBDLIB = '/app/DBD-Oracle/8i';
> } elsif(grep /^-9i$/, @ARGV) {
> $DBDLIB = '/app/DBD-Oracle/9i';
> } else {
> die "Please specify Oracle version.";
> }
> }
> use lib $DBDLIB;
> use DBD::Oracle;
> -----------------------------------------------------------------------
>
> - Kristian.
I prefer not to hardwire things like that in my scripts. I was
actually thinking it might be better to have a script in each
$ORACLE_HOME that sets $PERL5LIB appropriately for the Oracle
version.
YMMV
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.