The entry for the Shariff Kabunsuan region of the PHILIPPINES does not have a code. Apparently the ISO 3166.2 codes do not reflect recent changes in Philipino government structure.

Since the data set is accurate, one must then conclude that the code that parses the data set is in error. The code makes the assumption that any 'subcountry' will have both a 'name' and a 'code'.

I think the right thing to do is to patch the parsing logic to match the current coding style. The warning is correct, there is a problem with the code.

Submit a bug report and possibly a patch to the author.

I've made a feeble stab at fixing the code, but I don't know enough about localization standards to know if my implementation is correct.

Here is the relevant section of the original code, from around line 439:

# Insert into doubly indexed hash, grouped by country for ISO 3166-2 # codes. One hash is keyed by abbreviation and one by full name. Altho +ugh # data is duplicated, this provides the fastest lookup and simplest co +de. $::subcountry_lookup{$country_name}{_code_keyed}{$sub_country_code} = +$sub_country_name; $::subcountry_lookup{$country_name}{_full_name_keyed}{$sub_country_nam +e} = $sub_country_code; if ( $category ) { $::subcountry_lookup{$country_name}{$sub_country_code}{_category} += $category; } if ( $regional_division ) { $::subcountry_lookup{$country_name}{$sub_country_code}{_regional_d +ivision} = $regional_division; } if ( $FIPS_code ) { # Insert into doubly indexed hash, grouped by country for FIPS 10- +4 codes $::subcountry_lookup{$country_name}{_FIPS10_4_code_keyed}{$FIPS_co +de} = $sub_country_code; $::subcountry_lookup{$country_name}{_ISO3166_2_code_keyed}{$sub_co +untry_code} = $FIPS_code; }

Here are my untested modifications:

# Insert into doubly indexed hash, grouped by country for ISO 3166-2 # codes. One hash is keyed by abbreviation and one by full name. Altho +ugh # data is duplicated, this provides the fastest lookup and simplest co +de. $::subcountry_lookup{$country_name}{_full_name_keyed}{$sub_country_nam +e} = $sub_country_code || 'UNDEFINED'; # These items all depend on a sub_country_code being set. if ( $sub_country_code ) { $::subcountry_lookup{$country_name}{_code_keyed}{$sub_country_code +} = $sub_country_name; if ( $category ) { $::subcountry_lookup{$country_name}{$sub_country_code}{_catego +ry} = $category; } if ( $regional_division ) { $::subcountry_lookup{$country_name}{$sub_country_code}{_region +al_division} = $regional_division; } if ( $FIPS_code ) { # Insert into doubly indexed hash, grouped by country for FIPS + 10-4 codes $::subcountry_lookup{$country_name}{_FIPS10_4_code_keyed}{$FIP +S_code} = $sub_country_code; $::subcountry_lookup{$country_name}{_ISO3166_2_code_keyed}{$su +b_country_code} = $FIPS_code; } }


TGI says moo


In reply to Re: Warning will not supresss by TGI
in thread Warning will not supresss by genyded

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.