... 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) { ...