NAME
Locale::Country::SubCountry::Database::Export - Country names in English, and subcountry names in native scripts
Synopsis
See Locale::Country::SubCountry.
Description
Locale::Country::SubCountry provides subcountry names in their native scripts.
Methods
all_countries()
Read the whole 'countries' table.
Returns an arrayref, 1 element per country, where each element is a hashref with these keys:
- o id
-
Unique identifier for the country. Actually the database's primary key.
- o address_format
-
A string showing how to format an address in this country. Only set for some countries.
Split the string on '#' characters, to produce a format of N lines.
Replace the tokens ':X' with the corresponding data (if available).
- o code2
-
The ISO3166-1 2-letter code for the country.
- o code3
-
The ISO3166-1 3-letter code for the country.
- o name
-
The name of the country, in English.
all_subcountries()
Read the whole 'sub_countries' table.
Returns an arrayref, 1 element per subcountry, where each element is a hashref with these keys:
- o id
-
Unique identifier for the subcountry. Actually the database's primary key.
- o country_id
-
The primary key into the 'countries' table.
- o code
-
The ISO3166-2 1 .. 5-letter code for the country.
- o name
-
The name of the subcountry, in the country's native script.
countries_as_csv()
Print to STDOUT a CSV version of the 'countries' table.
The output should match data/countries, except for slight variations in sort order.
countries_as_html()
Return a string of HTML containing a table of most country data (name, code2, code3, address_format).
See the -whole_page option in scripts/export.countries.as.html.pl for how to output either just a HTML table (for inclusion in a web page), or a whole web page.
The templates for this HTML are in htdocs/assets/templates/locale/country/subcountry/.
init()
For use by subclasses.
Sets default values for object attributes.
new()
For use by subclasses.
sub_countries_as_csv()
Print to STDOUT a CSV version of the 'sub_countries' table.
The output should match data/sub_countries, except for slight variations in sort order.
sub_countries_as_html()
Return a string of HTML containing a table of most subcountry data (country_id, code, name).
See the -whole_page option in scripts/export.countries.as.html.pl for how to output either just a HTML table (for inclusion in a web page), or a whole web page.
The templates for this HTML are in htdocs/assets/templates/locale/country/subcountry/.
Support
Email the author, or log a bug on RT:
https://rt.cpan.org/Public/Dist/Display.html?Name=Locale::Country::SubCountry.
Author
Locale::Country::SubCountry was written by Ron Savage <ron@savage.net.au> in 2011.
Home page: http://savage.net.au/index.html.
Copyright
Australian copyright (c) 2011, Ron Savage.
All Programs of mine are 'OSI Certified Open Source Software';
you can redistribute them and/or modify them under the terms of
The Artistic License, a copy of which is available at:
http://www.opensource.org/licenses/index.html