Okay, this is really, really sloppy, but it's much closer in intent to what Randal was
talking
about (only relevant code is presented):
my @data = qw/
all_cl p5_cl p299_cl imp143_cl imp5_cl
all_cl_think p5_cl_think p299_cl_think imp143_cl_think imp5_cl_think
imp_14_cl_think val_cl_think all_cl_stagger p5_cl_stagger p299_cl_stagger
imp143_cl_stagger imp5_cl_stagger imp_14_cl_stagger val_cl_stagger all_fast
imp1_5_fast imp1_14_fast imp1_143_fast pact_5_fast pact_299_fast
valid_fast all_sleepy imp1_5_sleepy imp1_14_sleepy imp1_143_sleepy
pact_5_sleepy pact_299_sleepy valid_sleepy imp_14_cl val_c /;
my %config_data = map { ("g_$_" => undef) } @data;
$config_data{ acf2_file } = undef;
my %actual_data = %{ doConf( $conf, \%directives, \%config_data ) };
sub doConf
{
my ($conf, $directives, $config_data) = @_;
while (($directive, $config_info) = each(%{$directives}))
{
my ($value) = $conf->get($directive);
if (defined($value))
{
$config_data->{ $config_info } = $value;
print "$config_data->{ $config_info } = $value\n";
}
}
return $config_data;
}
Note that we assign the results to %actual_data to prevent wiping out keys in
%config_data that
were not assigned to. Again, this is not great code, but it gives you an idea of what
he meant.
Cheers,
Curtis "Ovid" Poe
=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/
__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]