OK, I like your idea of the associative arrays in the cfg file rather than the 200+ if elsif statements in the html.pl file.
Still can't get it to work however. Here are some code snipets. Let's say I'm searching for records with the field Australia.
The first snipet is per your recommendation and the associative array. I've only listed through Australia.
%Countries = ('Afghanistan' => "AFG",
'Albania' => "ALB",
'Algeria' => "DZA",
'American Samoa' => "ASM",
'Andorra' => "AND",
'Angola' => "AGO",
'Anguilla' => "AIA",
'Antigua and Barbuda' => "ATG",
'Argentina' => "ARG",
'Armenia' => "ARM",
'Aruba' => "ABW",
'Australia' => "AUS",
----------------------------->
This next snipet is the select field setup in the cfg file for County. There are several select fields, this is just one, hence the trailing comma at the end.
%db_select_fields = (
Country => 'Afghanistan,Albania,Algeria,American Samoa,Andorra,Angola,Anguilla,Antigua and Barbuda,Argentina,Armenia,Aruba,Australia,Austria,Azerbaijan,Bahamas,Bahrain,Bangladesh,Barbados,Belarus,Belgium,Belize,Benin,Bermuda,Bhutan ,Bolivia,Bosnia and Herzegowina,Botswana,Brazil,British Virgin Islands,Brunei Darussalam,Bulgaria,Burkina Faso,Burundi,Cambodia,Cameroon,Cape Verde,Cayman Islands,Central African Republic,Chad,Chile,China,Colombia,Comoros,Congo,Cook Islands,Costa Rica,Croatia,Cuba,Cyprus,Czech Republic,Denmark,Djibouti,Dominica,Dominican Republic,Ecuador,Egypt,El Salvador,Equatorial Guinea,Eritrea,Estonia,Ethiopia,Falkland Islands,Faroe Islands,Fiji,Finland,France,French Guiana,French Polynesia,Gabon,Gambia,Georgia,Germany,Ghana,Gibraltar,Greece,Greenland,Grenada,Guadeloupe,Guatemala,Guinea,Guinea Bissau,Guyana,Haiti,Honduras,Hong Kong,Hungary,Iceland,India,Indonesia,Iran,Iraq,Ireland,Israel,Italy,Ivory Coast,Jamaica,Japan,Jordan,Kazakhstan,Kenya,Kiribati,Kuwait,Kyrgyzstan,Laos,Latvia,Lebanon,Lesotho,Liberia,Libya,Liechnstein,Lithuania,Luxem bourg,Macau,Macedonia,Madagascar,Malawi,Malaysia,Maldives,Mali,Malta,Marshall Islands,Martinique,Mauritania,Mauritius,Mexico,Micronesia,Moldova,Monaco,Mongolia,Montserrat,Morocco,Mozambique,Myanmar,Namibia,Nepal,Nether lands,Netherlands Antilles,New Caledonia,New Zealand,Nicaragua,Niger,Nigeria,Norfolk Island,North Korea,Northern Mariana Islands,Norway,Oman,Pakistan,Palau,Panama,Papua New Guinea,Paraguay,Peru,Philippines,Poland,Portugal,Puerto Rico,Qatar,Reunion,Romania,Russia,Rwanda,Saint Helena,Saint Kitts and Nevis,Saint Lucia,Saint Pierre and Miquelon,Saint Vincent/Grenadines,Samoa,San Marino,Saotome and Principe,Saudi Arabia,Senegal,Seychelles,Sierra Leone,Singapore,Slovak Republic,Slovenia,Solomon Islands,Somalia,South Africa,South Korea,Spain,Sri Lanka,Sudan,Suriname,Swaziland,Sweden,Switzerland,Syria,Tahiti,Taiwan,Tajikistan,Tanzania,Thailand,Togo,Tokelau,Tonga,Trinidad and Tobago,Tunisia,Turkey,Turkmenistan,Turks and Caicos Islands,Uganda,Ukraine,United Arab Emirates,United Kingdom,United States of America,US Virgin Islands,Uruguay,Uzbekistan,Vanuatu,Vatican,Venezuela,Vietnam,Western Sahara,Yemen,Yugoslavia,Zambia,Zimbabwe',
------------------------>
Note in both cases the length of Australia is 9 characters.
I put in the debug line you suggested (print length($rec{'Country'})
and here's what I get for 11 records
22 16 16 16 16 16 16 16 16 16 16
Now in the db file -- I checked and there are 11 records with the country field of Australia and they are all exactly 9 characters in length.
So how can I get the above lengths 22 16 ...?
Needless to say, it isn't working.
Any ideas?