my $db_hash = do { no strict 'refs'; \%$DB_name };
while (($key,$value) = each %$db_hash) {
print "\tKey :: $key\n" ;
print "\tValue :: $value\n" ;
}
####
...
my %DBHashLookup = (
ISWLIVE => [ \%ISWLIVE, \%ISWLIVE_PATH ],
ISWTEST => [ \%ISWTEST, \%ISWTEST_PATH ],
ISWTEACH => [ \%ISWTEACH, \%ISWTEACH_PATH ],
);
...
$DB_name = $ARGV[0];
$DB_info = $DBHashLookup{$DB_name};
if (defined($DB_info)) {
($DB_hash, $Path_hash) = @$DB_info;
print "\n\tProcessing $DB_name Environment.\n\n" ;
...
while (($key,$value) = each %$DB_hash) {
...
##
##
$param_no = scalar @ARGV ;
#
if ($param_no != 1) # Other than one parameter has been supplied
{
print "\n\t<***** There MUST be a parameter supplied! *****>" ;
print "\n\n\t<***** $script Failed to run. *****>\n\n" ;
$msg = "DB name parameter not supplied" ;
&end_it($mail_msg,$to,$from,$subject,$msg,$topline) ;
}
#
$DB_name = $ARGV[0];
$DB_info = $DBHashLookup{$DB_name};
#
if (!defined($DB_hash)) {
print "\n\tThink again muppett!\n" ;
$msg = "$DB_name is not a database known to this script!" ;
&end_it($mail_msg,$to,$from,$subject,$msg,$topline) ;
}
#
print "\n\tProcessing $DB_name Environment.\n\n" ;
#
($DB_hash, $Path_hash) = @$DB_info;
while (($key,$value) = each %$DB_hash) {
print "\tKey :: $key\n" ;
print "\tValue :: $value\n" ;
}
#