{"id":18909986,"url":"https://github.com/jonasbn/perl-business-gl-postalcode","last_synced_at":"2026-03-06T17:05:14.543Z","repository":{"id":14734112,"uuid":"17454953","full_name":"jonasbn/perl-business-gl-postalcode","owner":"jonasbn","description":"Validation of Greenlandic postal codes","archived":false,"fork":false,"pushed_at":"2025-05-25T17:11:05.000Z","size":142,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-18T13:45:33.517Z","etag":null,"topics":["cpan","hacktoberfest","perl","perl5","validation"],"latest_commit_sha":null,"homepage":"https://metacpan.org/release/Business-GL-Postalcode","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonasbn.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-03-05T20:54:36.000Z","updated_at":"2025-05-25T17:10:33.000Z","dependencies_parsed_at":"2023-11-29T16:28:36.381Z","dependency_job_id":"98607149-ff8e-4a23-be95-2571b826f1b9","html_url":"https://github.com/jonasbn/perl-business-gl-postalcode","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jonasbn/perl-business-gl-postalcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fperl-business-gl-postalcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fperl-business-gl-postalcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fperl-business-gl-postalcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fperl-business-gl-postalcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonasbn","download_url":"https://codeload.github.com/jonasbn/perl-business-gl-postalcode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fperl-business-gl-postalcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30186780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T14:42:24.748Z","status":"ssl_error","status_checked_at":"2026-03-06T14:42:14.925Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpan","hacktoberfest","perl","perl5","validation"],"created_at":"2024-11-08T09:38:53.952Z","updated_at":"2026-03-06T17:05:09.529Z","avatar_url":"https://github.com/jonasbn.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CPAN version](https://badge.fury.io/pl/Business-GL-Postalcode.svg)](http://badge.fury.io/pl/Business-GL-Postalcode)\n[![Build Status](https://travis-ci.org/jonasbn/perl-Business-GL-Postalcode.svg?branch=master)](https://travis-ci.org/jonasbn/perl-Business-GL-Postalcode)\n[![Coverage Status](https://coveralls.io/repos/jonasbn/perl-Business-GL-Postalcode/badge.png)](https://coveralls.io/r/jonasbn/perl-Business-GL-Postalcode)\n\n# NAME\n\nBusiness::GL::Postalcode - Greenland postal code validator and container\n\n# VERSION\n\nThis documentation describes version 0.02\n\n# SYNOPSIS\n\n    # basic validation of string\n    use Business::GL::Postalcode qw(validate);\n\n    if (validate($postalcode)) {\n        print \"We have a valid Greenland postal code\\n\";\n    } else {\n        warn \"Not a valid Greenland postal code\\n\";\n    }\n\n\n    # basic validation of string, using less intrusive subroutine\n    use Business::GL::Postalcode qw(validate_postalcode);\n\n    if (validate_postalcode($postalcode)) {\n        print \"We have a valid Greenland postal code\\n\";\n    } else {\n        warn \"Not a valid Greenland postal code\\n\";\n    }\n\n\n    # using the untainted return value\n    use Business::GL::Postalcode qw(validate_postalcode);\n\n    if (my $untainted = validate_postalcode($postalcode)) {\n        print \"We have a valid Greenland postal code: $untainted\\n\";\n    } else {\n        warn \"Not a valid Greenland postal code\\n\";\n    }\n\n\n    # All postal codes for use outside this module\n    use Business::GL::Postalcode qw(get_all_postalcodes);\n\n    my @postalcodes = @{get_all_postalcodes()};\n\n\n    # All postal codes and data for use outside this module\n    use Business::GL::Postalcode qw(get_all_data);\n\n    my $postalcodes = get_all_data();\n\n    foreach (@{postalcodes}) {\n        printf\n            'postal code: %s city: %s street/desc: %s company: %s province: %d country: %d', split /;/, $_, 6;\n    }\n\n# FEATURES\n\n- Providing list of Greenland postal codes and related area names\n- Look up methods for Greenland postal codes for web applications and the like\n- The postal code for Santa Claus (father Christmas)\n\n# DESCRIPTION\n\nThis distribution is not the original resource for the included data, but simply\nacts as a simple distribution for Perl use. The central source is monitored so this\ndistribution can contain the newest data. The monitor script (`postdanmark.pl`) is\nincluded in the distribution: [https://metacpan.org/pod/Business::DK::Postalcode](https://metacpan.org/pod/Business::DK::Postalcode).\n\nThe data are converted for inclusion in this module. You can use different extraction\nsubroutines depending on your needs:\n\n- [\"get\\_all\\_data\"](#get_all_data), to retrieve all data, data description below in [\"Data\"](#data).\n- [\"get\\_all\\_postalcodes\"](#get_all_postalcodes), to retrieve all postal codes\n- [\"get\\_all\\_cities\"](#get_all_cities), to retieve all cities\n- [\"get\\_postalcode\\_from\\_city\"](#get_postalcode_from_city), to retrieve one or more postal codes from a city name\n- [\"get\\_city\\_from\\_postalcode\"](#get_city_from_postalcode), to retieve a city name from a postal code\n\n## Data\n\nHere follows a description of the included data, based on the description from\nthe original source and the authors interpretation of the data, including\ndetails on the distribution of the data.\n\n### city name\n\nA non-unique, case-sensitive representation of a city name in Greenlandic or Danish.\n\n### street/description\n\nThis field is unused for this dataset.\n\n### company name\n\nThis field is unused for this dataset.\n\n### province\n\nThis field is a bit special and it's use is expected to be related to distribution\nall entries are marked as 'False'. The data are included since they are a part of\nthe original data.\n\n### country\n\nSince the original source contains data on 3 different countries:\n\n- Denmark (1)\n- Greenland (2)\n- Faroe Islands (3)\n\nOnly the data representing Greenland has been included in this distribution, so this\nfield is always containing a '2'.\n\nFor access to the data on Denmark or Faroe Islands please refer to: [Business::DK::Postalcode](https://metacpan.org/pod/Business::DK::Postalcode)\nand [Business::FO::Postalcode](https://metacpan.org/pod/Business::FO::Postalcode) respectfully.\n\n## Encoding\n\nThe data distributed are in Greenlandic and Danish for descriptions and names and these are encoded in UTF-8.\n\n# SUBROUTINES AND METHODS\n\n## validate\n\nA simple validator for Greenlandic postal codes.\n\nTakes a string representing a possible Greenlandic postal code and returns either\n**1** or **0** indicating either validity or invalidity.\n\n    my $rv = validate(3900);\n\n    if ($rv == 1) {\n        print \"We have a valid Greenlandic postal code\\n\";\n    } ($rv == 0) {\n        print \"Not a valid Greenlandic postal code\\n\";\n    }\n\n## validate\\_postalcode\n\nA less intrusive subroutine for import. Acts as a wrapper of [\"validate\"](#validate).\n\n    my $rv = validate_postalcode(2412);\n\n    if ($rv) {\n        print \"We have a valid Greenlandic postal code\\n\";\n    } else {\n        print \"Not a valid Greenlandic postal code\\n\";\n    }\n\n## get\\_all\\_data\n\nReturns a reference to a a list of strings, separated by tab characters. See\n[\"Data\"](#data) for a description of the fields.\n\n    use Business::GL::Postalcode qw(get_all_data);\n\n    my $postalcodes = get_all_data();\n\n    foreach (@{postalcodes}) {\n        printf\n            'postalcode: %s city: %s street/desc: %s company: %s province: %d country: %d', split /\\t/, $_, 6;\n    }\n\n## get\\_all\\_postalcodes\n\nTakes no parameters.\n\nReturns a reference to an array containing all valid Danish postal codes.\n\n    use Business::GL::Postalcode qw(get_all_postalcodes);\n\n    my $postalcodes = get_all_postalcodes;\n\n    foreach my $postalcode (@{$postalcodes}) { ... }\n\n## get\\_all\\_cities\n\nTakes no parameters.\n\nReturns a reference to an array containing all Danish city names having a postal code.\n\n    use Business::GL::Postalcode qw(get_all_cities);\n\n    my $cities = get_all_cities;\n\n    foreach my $city (@{$cities}) { ... }\n\nPlease note that this data source used in this distribution by no means is authorative\nwhen it comes to cities located in Denmark, it might have all cities listed, but\nunfortunately also other post distribution data.\n\n## get\\_city\\_from\\_postalcode\n\nTakes a string representing a Danish postal code.\n\nReturns a single string representing the related city name or an empty string indicating nothing was found.\n\n    use Business::GL::Postalcode qw(get_city_from_postalcode);\n\n    my $zipcode = '3900';\n\n    my $city = get_city_from_postalcode($zipcode);\n\n    if ($city) {\n        print \"We found a city for $zipcode\\n\";\n    } else {\n        warn \"No city found for $zipcode\";\n    }\n\n## get\\_postalcode\\_from\\_city\n\nTakes a string representing a Danish/Greenlandic city name.\n\nReturns a reference to an array containing zero or more postal codes related to that city name. Zero indicates nothing was found.\n\nPlease note that city names are not unique, hence the possibility of a list of postal codes.\n\n    use Business::GL::Postalcode qw(get_postalcode_from_city);\n\n    my $city = 'Nuuk';\n\n    my $postalcodes = get_postalcode_from_city($city);\n\n    if (scalar @{$postalcodes} == 1) {\n        print \"$city is unique\\n\";\n    } elsif (scalar @{$postalcodes} \u003e 1) {\n        warn \"$city is NOT unique\\n\";\n    } else {\n        die \"$city not found\\n\";\n    }\n\n# DIAGNOSTICS\n\nThere are not special diagnostics apart from the ones related to the different\nsubroutines.\n\n# CONFIGURATION AND ENVIRONMENT\n\nThis distribution requires no special configuration or environment.\n\n# DEPENDENCIES\n\n- [https://metacpan.org/pod/Carp](https://metacpan.org/pod/Carp) (core)\n- [https://metacpan.org/pod/Exporter](https://metacpan.org/pod/Exporter) (core)\n- [https://metacpan.org/pod/Data::Handle](https://metacpan.org/pod/Data::Handle)\n- [https://metacpan.org/pod/List::Util](https://metacpan.org/pod/List::Util)\n- [https://metacpan.org/pod/Params::Validate](https://metacpan.org/pod/Params::Validate)\n\n## TEST\n\nPlease note that the above list does not reflect requirements for:\n\n- Additional components in this distribution, see `lib/`. Additional\ncomponents list own requirements\n- Test and build system, please see: `Build.PL` for details\n\n# BUGS AND LIMITATIONS\n\nThere are no known bugs at this time.\n\nThe data source used in this distribution by no means is authorative when it\ncomes to cities located in Denmark, it might have all cities listed, but\nunfortunately also other post distribution data.\n\n# BUG REPORTING\n\nPlease report issues via CPAN RT:\n\n- Web (RT): [http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-GL-Postalcode](http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-GL-Postalcode)\n- Web (Github): [https://github.com/jonasbn/perl-Business-GL-Postalcode/issues](https://github.com/jonasbn/perl-Business-GL-Postalcode/issues)\n- Email (RT): [bug-Business-GL-Postalcode@rt.cpan.org](https://metacpan.org/pod/bug-Business-GL-Postalcode@rt.cpan.org)\n\n# SEE ALSO\n\n- [Business::DK::Postalcode](https://metacpan.org/pod/Business::DK::Postalcode)\n- [Business::FO::Postalcode](https://metacpan.org/pod/Business::FO::Postalcode)\n\n# MOTIVATION\n\nPostdanmark the largest danish postal and formerly stateowned postal service, maintain the\npostalcode mapping for Greenland and the Faroe Islands. Since I am using this resource to\nmaintain the danish postalcodes I decided to release distributions of these two other countries.\n\n# AUTHOR\n\nJonas B. Nielsen, (jonasbn) - `\u003cjonasbn@cpan.org\u003e`\n\n# COPYRIGHT\n\nBusiness-GL-Postalcode is (C) by Jonas B., (jonasbn) 2014-2019\n\nBusiness-GL-Postalcode is released under the artistic license 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbn%2Fperl-business-gl-postalcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonasbn%2Fperl-business-gl-postalcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbn%2Fperl-business-gl-postalcode/lists"}