-- Ellen Yu <[EMAIL PROTECTED]> on 09/18/02 09:59:41 -0700
> A related question:
>
> Is there anyway to "hard code" the Oracle environment variables somewhere
> in the perl directories such that if someone uses "/usr/bin/perl" they
> will automatically use a certain Oracle client directory. My shop has
> several client versions of Oracle and some of them would have to either
> reset their environment variables or change their perl scripts.
>
> I'm trying to think of a way where they don't have to do either,
> preferably without multiple installations of perl.
Use a single module that checks the versions and exports
an environment based on the internal logic. Locate the
module in separate perl installations and you'd have perl-
specific settings; share them and you'd have oracle-specific
settings.
Something like:
my %baseenv =
(
foo => 'bar',
...
# constant between shells
HOME => $ENV{HOME},
TERM => $ENV{TERM},
...
);
if( (my $a = subcall_that_checks_oracle) eq '1.2.3.4' )
{
$baseenv{ORACLE_HOME} = 'whatever'
}
elsif( $a eq '4.3.2.1' )
{
$baseenv{ORACLE_HOME} = 'whatever-else';
}
....
%ENV = %baseenv;
exit system( $ENV{SHELL} );
--
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 800 762 1582