4 title => 'country code cheat sheet',
7 "Table of ISO-3166-2 country codes with the names of reserved territories.",
8 keywords => [qw'country code cc tld territory land table'],
9 stylesheet => [qw'light dark circus mono red'],
13 <h1>ISO-3166-2α2 Country codes</h1>
16 my $cc = do 'countries.inc.pl';
19 printf '<table class="mcmap">';
20 print '<col><colgroup span="26">';
21 for my $section (qw{thead}) {
22 print "<$section><tr><th>↳";
23 print '<th>', $_ for 'a' .. 'z';
27 for my $row ('a' .. 'z') {
28 print '<tr><th>', $row;
29 for my $col ('a' .. 'z') {
30 my $code = $row . $col;
31 my $country = $cc->{$code} or do {
32 print $code =~ /^x|^q[m-z]|^aa|^zz/ ? '<td class="X Co">' : '<td>';
35 my ($name, $class, $short, $ref) = @$country;
38 if (exists $get{show}) {
39 my $img = "flag/$ref.png";
40 $_ = sprintf '<img src="/%s" alt="%s">', $img, $ref if -e $img;
43 $_ = EscapeHTML($short || $name);
45 printf "\n".'<td class="%s" title="%s">%s',
46 $_ ? 'X '.$class : '', EscapeHTML("$code: $name"), $_;
57 <table class="glyphs"><tr>
58 <td class="X c-af">africa
59 <td class="X c-eu">europe
60 <td class="X c-as">asia
61 <td class="X c-aa">antarctica
62 <td class="X c-oc">oceania
63 <td class="X c-sa">south america
64 <td class="X c-na">north america
66 <td class="X Co">user-assigned
70 <ul class="legend legend-set">
71 <li><strong>show</strong>
72 <em><:= exists $get{show} ? 'flag images' : 'english names' :></em><:=
73 !exists $get{show} && ' by default' :>
74 <li>default <strong>style</strong> is
75 <:= defined $get{style} && 'set to ' :><em><:= $style :></em>