Folks,
I am using the ConfigReader.pm and have the following setup...
yes, I am using -w and strict ;)
my
($g_all_cl,$g_p5_cl,$g_p299_cl,$g_imp143_cl,$g_imp5_cl,$g_imp_14_cl,$g_val_c
l,
$g_all_cl_think,$g_p5_cl_think,$g_p299_cl_think,$g_imp143_cl_think,$g_imp5_c
l_think,
$g_imp_14_cl_think,$g_val_cl_think,$g_all_cl_stagger,$g_p5_cl_stagger,
$g_p299_cl_stagger,$g_imp143_cl_stagger,$g_imp5_cl_stagger,$g_imp_14_cl_stag
ger,
$g_val_cl_stagger,$g_all_fast,$g_imp1_5_fast,$g_imp1_14_fast,$g_imp1_143_fas
t,
$g_pact_5_fast,$g_pact_299_fast,$g_valid_fast,$g_all_sleepy,$g_imp1_5_sleepy
,
$g_imp1_14_sleepy,$g_imp1_143_sleepy,$g_pact_5_sleepy,$g_pact_299_sleepy,$g_
valid_sleepy,
$acf2_file );
sub ReadConfigFile () {
my ($cfg_file) = @_;
my $config = "$opt_libdir$cfg_file";
if ($config && -r $config)
{
my $conf = ConfigReaderSimple->new($config);
print "Parsing $config file\n";
my %directives = ();
$conf->parse();
%directives = (
##
## Database / Engine Settings
##
"DBHost", "db_host",
"DBUsername", "db_user",
"DBPassword", "db_pass",
"DBName", "db_name",
"ACF2", "acf2_file",
##
## Number of Clients
##
"ALL_CLIENTS", "g_all_cl",
"PACTIVE_0299_CLIENTS", "g_p5_cl",
"PACTIVE_0005_CLIENTS", "g_p299_cl",
"IMP_143_CLIENTS", "g_imp143_cl",
"IMP_5_CLIENTS", "g_imp5_cl",
"IMP_14_CLIENTS", "g_imp_14_cl",
"VALID_CLIENTS", "g_val_cl",
##
## Think Settings
##
"ALL_CLIENTS_THINK", "g_all_cl_think",
"PACTIVE_0299_CLIENTS_THINK", "g_p5_cl_think",
"PACTIVE_0005_CLIENTS_THINK", "g_p299_cl_think",
"IMP_143_CLIENTS_THINK", "g_imp143_cl_think",
"IMP_5_CLIENTS_THINK", "g_imp5_cl_think",
"IMP_14_CLIENTS_THINK", "g_imp_14_cl_think",
"VALID_CLIENTS_THINK", "g_val_cl_think",
##
## Stagger Settings
##
"ALL_CLIENTS_STAGGER", "g_all_cl_stagger",
"PACTIVE_0299_CLIENTS_STAGGER", "g_p5_cl_stagger",
"PACTIVE_0005_CLIENTS_STAGGER", "g_p299_cl_stagger",
"IMP_143_CLIENTS_STAGGER", "g_imp143_cl_stagger",
"IMP_5_CLIENTS_STAGGER", "g_imp5_cl_stagger",
"IMP_14_CLIENTS_STAGGER", "g_imp_14_cl_stagger",
"VALID_CLIENTS_STAGGER", "g_val_cl_stagger",
##
## Fast Start .scr script names
##
"ALL_FAST", "g_all_fast",
"IMP1_5_FAST", "g_imp1_5_fast",
"IMP1_14_FAST", "g_imp1_14_fast",
"IMP1_143_FAST", "g_imp1_143_fast",
"PACT_5_FAST", "g_pact_5_fast",
"PACT_299_FAST", "g_pact_299_fast",
"VALID_FAST", "g_valid_fast",
##
## Sleepy Start .scr script names
##
"ALL_SLEEPY", "g_all_sleepy",
"IMP1_5_SLEEPY", "g_imp1_5_sleepy",
"IMP1_14_SLEEPY", "g_imp1_14_sleepy",
"IMP1_143_SLEEPY", "g_imp1_143_sleepy",
"PACT_5_SLEEPY", "g_pact_5_sleepy",
"PACT_299_SLEEPY", "g_pact_299_sleepy",
"VALID_SLEEPY", "g_valid_sleepy",
##
## Debug settings
##
"Debug", "g_debug",
);
&doConf($conf, %directives);
print "=>$acf2_file\n";
}
else
{
die( "-- Warning: unable to open configuration file '$config':
$!\n");
}
I know the config file is being read.. I have the DEBUG set to 1 and see all
the key/value pairs
I also have the following to populate the variables above
#
# void doConf (object conf, hash directives)
#
# Walk through configuration directives, setting values of global variables.
#
sub doConf
{
my ($conf, %directives) = @_;
while (($directive, $variable) = each(%directives))
{
my ($value) = $conf->get($directive);
if (defined($value))
{
$$variable = $value;
print "$variable = $value\n";
}
}
}
I am able to read in the variables and see that the &doConf is populating
them
BUT the print above (print "=>$acf2_file\n";) just prints the => no value
here is the value being read in from ConfigReader.pm
Key: 'ACF2' Value: 'loadTestThruACF2wVQnnnn.sh'
and in the &doConf
acf2_file = loadTestThruACF2wVQnnnn.sh
what am I missing?
Regards,
-Ron
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]