Weather-GHCN-Fetch

 view release on metacpan or  search on metacpan

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

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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 0.277 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )