Weather-GHCN-Fetch

 view release on metacpan or  search on metacpan

lib/Weather/GHCN/CountryCodes.pm  view on Meta::CPAN


const my $EMPTY  => q();    # empty string
const my $SPACE  => q( );   # space character
const my $TAB    => qq(\t); # tab character
const my $TRUE   => 1;      # perl's usual TRUE
const my $FALSE  => not $TRUE; # a dual-var consisting of '' and 0


#############################################################################

# Load the %Country hash during the UNITCHECK phase, before any of the
# regular runtime code needs it.

UNITCHECK {
    my @lines = split m{ \n }xms, country_table();

    foreach my $line (@lines) {
        my ($entity, $gec, $iso2, $iso3, $isonum, $nato, $internet, $comment) = split m{ [|] }xms, $line;

        # skip table entries with no GEC
        next if $gec eq q(-);

        # check for duplicates, though there shouldn't be any
        croak "*W* country $entity with GEC $gec already exists"



( run in 3.759 seconds using v1.01-cache-2.11-cpan-748bfb374f4 )