Common/Country.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 18 / 18 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Common/Color.pm ↑ Summary Common/CountryISO.pm »
1 package Enum::Declare::Common::Country;
2  
3 1 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Enum::Declare;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # ── ISO 3166-1 Alpha-2 codes (249 entries) ──
10  
11 enum Alpha2 :Str :Type :Export {
12 AD = "Andorra",
13 AE = "United Arab Emirates",
14 AF = "Afghanistan",
15 AG = "Antigua and Barbuda",
16 AI = "Anguilla",
17 AL = "Albania",
18 AM = "Armenia",
19 AO = "Angola",
20 AQ = "Antarctica",
21 AR = "Argentina",
22 AS = "American Samoa",
23 AT = "Austria",
24 AU = "Australia",
25 AW = "Aruba",
26 AX = "Aland Islands",
27 AZ = "Azerbaijan",
28 BA = "Bosnia and Herzegovina",
29 BB = "Barbados",
30 BD = "Bangladesh",
31 BE = "Belgium",
32 BF = "Burkina Faso",
33 BG = "Bulgaria",
34 BH = "Bahrain",
35 BI = "Burundi",
36 BJ = "Benin",
37 BL = "Saint Barthelemy",
38 BM = "Bermuda",
39 BN = "Brunei Darussalam",
40 BO = "Bolivia",
41 BQ = "Bonaire, Sint Eustatius and Saba",
42 BR = "Brazil",
43 BS = "Bahamas",
44 BT = "Bhutan",
45 BV = "Bouvet Island",
46 BW = "Botswana",
47 BY = "Belarus",
48 BZ = "Belize",
49 CA = "Canada",
50 CC = "Cocos (Keeling) Islands",
51 CD = "Congo, Democratic Republic of the",
52 CF = "Central African Republic",
53 CG = "Congo",
54 CH = "Switzerland",
55 CI = "Cote d'Ivoire",
56 CK = "Cook Islands",
57 CL = "Chile",
58 CM = "Cameroon",
59 CN = "China",
60 CO = "Colombia",
61 CR = "Costa Rica",
62 CU = "Cuba",
63 CV = "Cabo Verde",
64 CW = "Curacao",
65 CX = "Christmas Island",
66 CY = "Cyprus",
67 CZ = "Czechia",
68 DE = "Germany",
69 DJ = "Djibouti",
70 DK = "Denmark",
71 DM = "Dominica",
72 DO = "Dominican Republic",
73 DZ = "Algeria",
74 EC = "Ecuador",
75 EE = "Estonia",
76 EG = "Egypt",
77 EH = "Western Sahara",
78 ER = "Eritrea",
79 ES = "Spain",
80 ET = "Ethiopia",
81 FI = "Finland",
82 FJ = "Fiji",
83 FK = "Falkland Islands",
84 FM = "Micronesia",
85 FO = "Faroe Islands",
86 FR = "France",
87 GA = "Gabon",
88 GB = "United Kingdom",
89 GD = "Grenada",
90 GE = "Georgia",
91 GF = "French Guiana",
92 GG = "Guernsey",
93 GH = "Ghana",
94 GI = "Gibraltar",
95 GL = "Greenland",
96 GM = "Gambia",
97 GN = "Guinea",
98 GP = "Guadeloupe",
99 GQ = "Equatorial Guinea",
100 GR = "Greece",
101 GS = "South Georgia and the South Sandwich Islands",
102 GT = "Guatemala",
103 GU = "Guam",
104 GW = "Guinea-Bissau",
105 GY = "Guyana",
106 HK = "Hong Kong",
107 HM = "Heard Island and McDonald Islands",
108 HN = "Honduras",
109 HR = "Croatia",
110 HT = "Haiti",
111 HU = "Hungary",
112 ID = "Indonesia",
113 IE = "Ireland",
114 IL = "Israel",
115 IM = "Isle of Man",
116 IN = "India",
117 IO = "British Indian Ocean Territory",
118 IQ = "Iraq",
119 IR = "Iran",
120 IS = "Iceland",
121 IT = "Italy",
122 JE = "Jersey",
123 JM = "Jamaica",
124 JO = "Jordan",
125 JP = "Japan",
126 KE = "Kenya",
127 KG = "Kyrgyzstan",
128 KH = "Cambodia",
129 KI = "Kiribati",
130 KM = "Comoros",
131 KN = "Saint Kitts and Nevis",
132 KP = "North Korea",
133 KR = "South Korea",
134 KW = "Kuwait",
135 KY = "Cayman Islands",
136 KZ = "Kazakhstan",
137 LA = "Laos",
138 LB = "Lebanon",
139 LC = "Saint Lucia",
140 LI = "Liechtenstein",
141 LK = "Sri Lanka",
142 LR = "Liberia",
143 LS = "Lesotho",
144 LT = "Lithuania",
145 LU = "Luxembourg",
146 LV = "Latvia",
147 LY = "Libya",
148 MA = "Morocco",
149 MC = "Monaco",
150 MD = "Moldova",
151 ME = "Montenegro",
152 MF = "Saint Martin (French part)",
153 MG = "Madagascar",
154 MH = "Marshall Islands",
155 MK = "North Macedonia",
156 ML = "Mali",
157 MM = "Myanmar",
158 MN = "Mongolia",
159 MO = "Macao",
160 MP = "Northern Mariana Islands",
161 MQ = "Martinique",
162 MR = "Mauritania",
163 MS = "Montserrat",
164 MT = "Malta",
165 MU = "Mauritius",
166 MV = "Maldives",
167 MW = "Malawi",
168 MX = "Mexico",
169 MY = "Malaysia",
170 MZ = "Mozambique",
171 NA = "Namibia",
172 NC = "New Caledonia",
173 NE = "Niger",
174 NF = "Norfolk Island",
175 NG = "Nigeria",
176 NI = "Nicaragua",
177 NL = "Netherlands",
178 NO = "Norway",
179 NP = "Nepal",
180 NR = "Nauru",
181 NU = "Niue",
182 NZ = "New Zealand",
183 OM = "Oman",
184 PA = "Panama",
185 PE = "Peru",
186 PF = "French Polynesia",
187 PG = "Papua New Guinea",
188 PH = "Philippines",
189 PK = "Pakistan",
190 PL = "Poland",
191 PM = "Saint Pierre and Miquelon",
192 PN = "Pitcairn",
193 PR = "Puerto Rico",
194 PS = "Palestine",
195 PT = "Portugal",
196 PW = "Palau",
197 PY = "Paraguay",
198 QA = "Qatar",
199 RE = "Reunion",
200 RO = "Romania",
201 RS = "Serbia",
202 RU = "Russian Federation",
203 RW = "Rwanda",
204 SA = "Saudi Arabia",
205 SB = "Solomon Islands",
206 SC = "Seychelles",
207 SD = "Sudan",
208 SE = "Sweden",
209 SG = "Singapore",
210 SH = "Saint Helena",
211 SI = "Slovenia",
212 SJ = "Svalbard and Jan Mayen",
213 SK = "Slovakia",
214 SL = "Sierra Leone",
215 SM = "San Marino",
216 SN = "Senegal",
217 SO = "Somalia",
218 SR = "Suriname",
219 SS = "South Sudan",
220 ST = "Sao Tome and Principe",
221 SV = "El Salvador",
222 SX = "Sint Maarten (Dutch part)",
223 SY = "Syrian Arab Republic",
224 SZ = "Eswatini",
225 TC = "Turks and Caicos Islands",
226 TD = "Chad",
227 TF = "French Southern Territories",
228 TG = "Togo",
229 TH = "Thailand",
230 TJ = "Tajikistan",
231 TK = "Tokelau",
232 TL = "Timor-Leste",
233 TM = "Turkmenistan",
234 TN = "Tunisia",
235 TO = "Tonga",
236 TR = "Turkiye",
237 TT = "Trinidad and Tobago",
238 TV = "Tuvalu",
239 TW = "Taiwan",
240 TZ = "Tanzania",
241 UA = "Ukraine",
242 UG = "Uganda",
243 UM = "United States Minor Outlying Islands",
244 US = "United States",
245 UY = "Uruguay",
246 UZ = "Uzbekistan",
247 VA = "Holy See",
248 VC = "Saint Vincent and the Grenadines",
249 VE = "Venezuela",
250 VG = "Virgin Islands (British)",
251 VI = "Virgin Islands (U.S.)",
252 VN = "Vietnam",
253 VU = "Vanuatu",
254 WF = "Wallis and Futuna",
255 WS = "Samoa",
256 YE = "Yemen",
257 YT = "Mayotte",
258 ZA = "South Africa",
259 ZM = "Zambia",
260 ZW = "Zimbabwe"
261 1 };
262  
263 # ── ISO 3166-1 Alpha-3 codes (249 entries) ──
264  
265 enum Alpha3 :Str :Type :Export {
266 AND = "Andorra",
267 ARE = "United Arab Emirates",
268 AFG = "Afghanistan",
269 ATG = "Antigua and Barbuda",
270 AIA = "Anguilla",
271 ALB = "Albania",
272 ARM = "Armenia",
273 AGO = "Angola",
274 ATA = "Antarctica",
275 ARG = "Argentina",
276 ASM = "American Samoa",
277 AUT = "Austria",
278 AUS = "Australia",
279 ABW = "Aruba",
280 ALA = "Aland Islands",
281 AZE = "Azerbaijan",
282 BIH = "Bosnia and Herzegovina",
283 BRB = "Barbados",
284 BGD = "Bangladesh",
285 BEL = "Belgium",
286 BFA = "Burkina Faso",
287 BGR = "Bulgaria",
288 BHR = "Bahrain",
289 BDI = "Burundi",
290 BEN = "Benin",
291 BLM = "Saint Barthelemy",
292 BMU = "Bermuda",
293 BRN = "Brunei Darussalam",
294 BOL = "Bolivia",
295 BES = "Bonaire, Sint Eustatius and Saba",
296 BRA = "Brazil",
297 BHS = "Bahamas",
298 BTN = "Bhutan",
299 BVT = "Bouvet Island",
300 BWA = "Botswana",
301 BLR = "Belarus",
302 BLZ = "Belize",
303 CAN = "Canada",
304 CCK = "Cocos (Keeling) Islands",
305 COD = "Congo, Democratic Republic of the",
306 CAF = "Central African Republic",
307 COG = "Congo",
308 CHE = "Switzerland",
309 CIV = "Cote d'Ivoire",
310 COK = "Cook Islands",
311 CHL = "Chile",
312 CMR = "Cameroon",
313 CHN = "China",
314 COL = "Colombia",
315 CRI = "Costa Rica",
316 CUB = "Cuba",
317 CPV = "Cabo Verde",
318 CUW = "Curacao",
319 CXR = "Christmas Island",
320 CYP = "Cyprus",
321 CZE = "Czechia",
322 DEU = "Germany",
323 DJI = "Djibouti",
324 DNK = "Denmark",
325 DMA = "Dominica",
326 DOM = "Dominican Republic",
327 DZA = "Algeria",
328 ECU = "Ecuador",
329 EST = "Estonia",
330 EGY = "Egypt",
331 ESH = "Western Sahara",
332 ERI = "Eritrea",
333 ESP = "Spain",
334 ETH = "Ethiopia",
335 FIN = "Finland",
336 FJI = "Fiji",
337 FLK = "Falkland Islands",
338 FSM = "Micronesia",
339 FRO = "Faroe Islands",
340 FRA = "France",
341 GAB = "Gabon",
342 GBR = "United Kingdom",
343 GRD = "Grenada",
344 GEO = "Georgia",
345 GUF = "French Guiana",
346 GGY = "Guernsey",
347 GHA = "Ghana",
348 GIB = "Gibraltar",
349 GRL = "Greenland",
350 GMB = "Gambia",
351 GIN = "Guinea",
352 GLP = "Guadeloupe",
353 GNQ = "Equatorial Guinea",
354 GRC = "Greece",
355 SGS = "South Georgia and the South Sandwich Islands",
356 GTM = "Guatemala",
357 GUM = "Guam",
358 GNB = "Guinea-Bissau",
359 GUY = "Guyana",
360 HKG = "Hong Kong",
361 HMD = "Heard Island and McDonald Islands",
362 HND = "Honduras",
363 HRV = "Croatia",
364 HTI = "Haiti",
365 HUN = "Hungary",
366 IDN = "Indonesia",
367 IRL = "Ireland",
368 ISR = "Israel",
369 IMN = "Isle of Man",
370 IND = "India",
371 IOT = "British Indian Ocean Territory",
372 IRQ = "Iraq",
373 IRN = "Iran",
374 ISL = "Iceland",
375 ITA = "Italy",
376 JEY = "Jersey",
377 JAM = "Jamaica",
378 JOR = "Jordan",
379 JPN = "Japan",
380 KEN = "Kenya",
381 KGZ = "Kyrgyzstan",
382 KHM = "Cambodia",
383 KIR = "Kiribati",
384 COM = "Comoros",
385 KNA = "Saint Kitts and Nevis",
386 PRK = "North Korea",
387 KOR = "South Korea",
388 KWT = "Kuwait",
389 CYM = "Cayman Islands",
390 KAZ = "Kazakhstan",
391 LAO = "Laos",
392 LBN = "Lebanon",
393 LCA = "Saint Lucia",
394 LIE = "Liechtenstein",
395 LKA = "Sri Lanka",
396 LBR = "Liberia",
397 LSO = "Lesotho",
398 LTU = "Lithuania",
399 LUX = "Luxembourg",
400 LVA = "Latvia",
401 LBY = "Libya",
402 MAR = "Morocco",
403 MCO = "Monaco",
404 MDA = "Moldova",
405 MNE = "Montenegro",
406 MAF = "Saint Martin (French part)",
407 MDG = "Madagascar",
408 MHL = "Marshall Islands",
409 MKD = "North Macedonia",
410 MLI = "Mali",
411 MMR = "Myanmar",
412 MNG = "Mongolia",
413 MAC = "Macao",
414 MNP = "Northern Mariana Islands",
415 MTQ = "Martinique",
416 MRT = "Mauritania",
417 MSR = "Montserrat",
418 MLT = "Malta",
419 MUS = "Mauritius",
420 MDV = "Maldives",
421 MWI = "Malawi",
422 MEX = "Mexico",
423 MYS = "Malaysia",
424 MOZ = "Mozambique",
425 NAM = "Namibia",
426 NCL = "New Caledonia",
427 NER = "Niger",
428 NFK = "Norfolk Island",
429 NGA = "Nigeria",
430 NIC = "Nicaragua",
431 NLD = "Netherlands",
432 NOR = "Norway",
433 NPL = "Nepal",
434 NRU = "Nauru",
435 NIU = "Niue",
436 NZL = "New Zealand",
437 OMN = "Oman",
438 PAN = "Panama",
439 PER = "Peru",
440 PYF = "French Polynesia",
441 PNG = "Papua New Guinea",
442 PHL = "Philippines",
443 PAK = "Pakistan",
444 POL = "Poland",
445 SPM = "Saint Pierre and Miquelon",
446 PCN = "Pitcairn",
447 PRI = "Puerto Rico",
448 PSE = "Palestine",
449 PRT = "Portugal",
450 PLW = "Palau",
451 PRY = "Paraguay",
452 QAT = "Qatar",
453 REU = "Reunion",
454 ROU = "Romania",
455 SRB = "Serbia",
456 RUS = "Russian Federation",
457 RWA = "Rwanda",
458 SAU = "Saudi Arabia",
459 SLB = "Solomon Islands",
460 SYC = "Seychelles",
461 SDN = "Sudan",
462 SWE = "Sweden",
463 SGP = "Singapore",
464 SHN = "Saint Helena",
465 SVN = "Slovenia",
466 SJM = "Svalbard and Jan Mayen",
467 SVK = "Slovakia",
468 SLE = "Sierra Leone",
469 SMR = "San Marino",
470 SEN = "Senegal",
471 SOM = "Somalia",
472 SUR = "Suriname",
473 SSD = "South Sudan",
474 STP = "Sao Tome and Principe",
475 SLV = "El Salvador",
476 SXM = "Sint Maarten (Dutch part)",
477 SYR = "Syrian Arab Republic",
478 SWZ = "Eswatini",
479 TCA = "Turks and Caicos Islands",
480 TCD = "Chad",
481 ATF = "French Southern Territories",
482 TGO = "Togo",
483 THA = "Thailand",
484 TJK = "Tajikistan",
485 TKL = "Tokelau",
486 TLS = "Timor-Leste",
487 TKM = "Turkmenistan",
488 TUN = "Tunisia",
489 TON = "Tonga",
490 TUR = "Turkiye",
491 TTO = "Trinidad and Tobago",
492 TUV = "Tuvalu",
493 TWN = "Taiwan",
494 TZA = "Tanzania",
495 UKR = "Ukraine",
496 UGA = "Uganda",
497 UMI = "United States Minor Outlying Islands",
498 USA = "United States",
499 URY = "Uruguay",
500 UZB = "Uzbekistan",
501 VAT = "Holy See",
502 VCT = "Saint Vincent and the Grenadines",
503 VEN = "Venezuela",
504 VGB = "Virgin Islands (British)",
505 VIR = "Virgin Islands (U.S.)",
506 VNM = "Vietnam",
507 VUT = "Vanuatu",
508 WLF = "Wallis and Futuna",
509 WSM = "Samoa",
510 YEM = "Yemen",
511 MYT = "Mayotte",
512 ZAF = "South Africa",
513 ZMB = "Zambia",
514 ZWE = "Zimbabwe"
515 1 };
516  
517 1 1;
518  
519 =head1 NAME
520  
521 Enum::Declare::Common::Country - ISO 3166-1 country codes to country names
522  
523 =head1 SYNOPSIS
524  
525 use Enum::Declare::Common::Country;
526  
527 say US; # "United States of America"
528 say GB; # "United Kingdom"
529 say USA; # "United States of America"
530  
531 my $meta = Alpha2();
532 say $meta->count; # 249
533 say $meta->name('us'); # "US" (constant name)
534  
535 =head1 ENUMS
536  
537 =head2 Alpha2 :Str :Export
538  
539 249 ISO 3166-1 alpha-2 codes. Values are full country names.
540  
541 =head2 Alpha3 :Str :Export
542  
543 249 ISO 3166-1 alpha-3 codes. Values are full country names.
544  
545 =head1 AUTHOR
546  
547 LNATION C<< <email@lnation.org> >>
548  
549 =head1 LICENSE AND COPYRIGHT
550  
551 Copyright 2026 LNATION. Artistic License 2.0.
552  
553 =cut
« Common/Color.pm ↑ Summary Common/CountryISO.pm »