in reply to Validate Country by ISO 3166 data
my %country_hash; chomp (my @data_rows = <DATA>); foreach my $this_country (@data_rows) { my $country_code = substr($this_country,0,2); my $country_name = substr($this_country,3); $country_hash{$country_code} = $country_hash{$country_name} = $this_ +country; } # ... your tie code ... __DATA__ AF Afghanistan AL Albania DZ Algeria .....
In my eyes this would be easier to read and maintain. Also, special chars like the apostrophe Cote d'Ivoire no longer require escaping.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Validate Country by ISO 3166 data
by shotgunefx (Parson) on Mar 07, 2002 at 06:36 UTC | |
|
Re: Re: Validate Country by ISO 3166 data
by drewbie (Chaplain) on Mar 07, 2002 at 18:00 UTC | |
|
Re: Re: Validate Country by ISO 3166 data
by krazken (Scribe) on Mar 08, 2002 at 15:57 UTC |