Create your own module as exporter, db.pm for example, like something below.  
Place the file in any location specified in @INC, then call it in the perl 
program "use db;".

package db;

BEGIN {
        use Exporter();
        @ISA = qw(Exporter);
        @EXPORT = qw( $oUser $oPass $oString);
}

$oUser = "username";
$oPass = "passwork";
$oString = "connect_string";

return 1;

END {};

-----Original Message-----
From: Linda Ding [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 13, 2006 9:59 AM
To: [email protected]
Subject: how to hide oracle instance name within dbi code??


We have a requirement here that we can't hard code any oracle database 
instance name for security reasons. Is there any way we can pass the 
connection string (for example, the oracle tnsname alias), or put the 
instance name in a configuration file and somehow pass the information 
from the configuration to the DBI code,  so that the public won't see 
the actual instance name in the code???? I know we can do that in many 
other languages, but, can we do that using DBI for oracle???


use strict;
use DBI;

my $dbh = DBI->connect( 'dbi:Oracle:orcl',
                       'jeffrey',
                       'jeffspassword',
                     );


  
Thanks a lot for any input.

Linda

Reply via email to