{"id":18910010,"url":"https://github.com/jonasbn/bdkphn","last_synced_at":"2026-03-07T12:30:20.097Z","repository":{"id":12318511,"uuid":"14954192","full_name":"jonasbn/bdkphn","owner":"jonasbn","description":"Business::DK::Phonenumber - validation of Danish FI numbers","archived":false,"fork":false,"pushed_at":"2021-05-18T04:50:25.000Z","size":117,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T05:27:19.629Z","etag":null,"topics":["hacktoberfest","perl","perl5"],"latest_commit_sha":null,"homepage":"","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.mkdn","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}},"created_at":"2013-12-05T13:27:32.000Z","updated_at":"2022-10-01T06:58:30.000Z","dependencies_parsed_at":"2022-08-29T05:00:44.867Z","dependency_job_id":null,"html_url":"https://github.com/jonasbn/bdkphn","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fbdkphn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fbdkphn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fbdkphn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fbdkphn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonasbn","download_url":"https://codeload.github.com/jonasbn/bdkphn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239898462,"owners_count":19715212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hacktoberfest","perl","perl5"],"created_at":"2024-11-08T09:38:57.248Z","updated_at":"2026-03-07T12:30:20.062Z","avatar_url":"https://github.com/jonasbn.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CPAN version](https://badge.fury.io/pl/Business-DK-Phonenumber.svg)](http://badge.fury.io/pl/Business-DK-Phonenumber)\n[![Build Status](https://travis-ci.org/jonasbn/bdkphn.svg?branch=master)](https://travis-ci.org/jonasbn/bdkphn)\n[![Coverage Status](https://coveralls.io/repos/jonasbn/bdkphn/badge.png?branch=master)](https://coveralls.io/r/jonasbn/bdkphn?branch=master)\n\n# NAME\n\nBusiness::DK::Phonenumber - Danish telephone number validator/formatter\n\n# VERSION\n\nThis documentation describes version 0.09\n\n# SYNOPSIS\n\n    use Business::DK::Phonenumber qw(validate render);\n\n    #Validation\n    if (Business::DK::Phonenumber-\u003evalidate($phonenumber)) { ... }\n\n    #Default format\n    print Business::DK::Phonenumber-\u003erender($phonenum);\n    # +45 12 34 56 78\n\n    #Brief human readable Danish phone number format\n    print Business::DK::Phonenumber-\u003erender($phonenum, '%08d');\n    # 12345678\n\n    #Normal human readable Danish phonenumber format\n    print Business::DK::Phonenumber-\u003erender($phonenum, '%02d %02d %02d %02d');\n    # 12 34 56 78\n\n    #Generation of a single random number\n    Business::DK::Phonenumber-\u003egenerate();\n\n    #Generation of 100 random numbers, using another template\n    Business::DK::Phonenumber-\u003egenerate(100, '%02d %02d %02d %02d');\n\n# DESCRIPTION\n\nThis module offers functionality to validate, format and generate Danish\nphone numbers.\n\nThe validation can recognise telephone numbers is the following formats as\nDanish phone numbers.\n\n- 12345678\n- 4512345678\n- +4512345678\n\nWhite space characters are ignored.\n\nIn addition to validation the module offers generation of valid danish\nphone numbers. The purpose of using generated phone number is up to the user, but\nthe original intent is generation of varied sets of test data.\n\nIf you want to use OOP please have a look at:\n\n- [Class::Business::DK::Phonenumber](https://metacpan.org/pod/Class::Business::DK::Phonenumber)\n\nIf you are using [Data::FormValidator](https://metacpan.org/pod/Data::FormValidator)\n\n- [Data::FormValidator::Constraints::Business::DK::Phonenumber](https://metacpan.org/pod/Data::FormValidator::Constraints::Business::DK::Phonenumber)\n\n# SUBROUTINES AND METHODS\n\nThe following subroutines are to be used in a procedural manner.\n\n## validate($phonenumber)\n\nThis subroutine takes a string and validated whether it is a Danish phone number.\n\nReturns 1 (true) or 0 (false), depending on validity.\n\n## render($phonenumber, $template)\n\nReturns a phonenumber rendered according to the template parameter or the\ndefault.\n\n## generate($template, $amount)\n\nThis subroutine takes a string representing a phone number template and generates\nthe amount specified by second argument: amount. If no amount is specified only\na single random phone number is returned.\n\nThe subroutine returns an array, no matter what amount is specified.\n\n## \\_generate($template)\n\nThis is the actual generating method used by [\"generate\"](#generate).\n\nIt takes a single parameter, a string indicating the template for the formatting\nof the phone numbers to be generated.\n\nIt returns a single random number representing a Danish phone number formatted\nas outlined by the specified template.\n\n## validate\\_template\n\nThis method is used internally to validate template parameters. Please refer to\nPerl's sprintf for documentation.\n\n# DIAGNOSTICS\n\n- phone number not in recognisable format, the phone number provided to\nthe constructor is not parsable. Please evaluate what you are attempting to\nfeed to the constructor.\n- phone number parameter is mandatory for the constructor, please specify\nthe phone number parameter to the constructor in order to continue.\n- template not in recognisable format, the template provided to the\nconstructor is not in a parsable format, please evaluate what you attempting to\nfeed to the constructor.\n\n# CONFIGURATION AND ENVIRONMENT\n\nNo special configuration or environment is necessary.\n\n# DEPENDENCIES\n\n- [Carp](https://metacpan.org/pod/Carp)\n- [Exporter](https://metacpan.org/pod/Exporter)\n\n# INCOMPATIBILITIES\n\nNo known incompatibilities at this time.\n\n# BUGS AND LIMITATIONS\n\nNo known bugs or limitations at this time.\n\n# TEST AND QUALITY\n\n- The [Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators](https://metacpan.org/pod/Perl::Critic::Policy::ValuesAndExpressions::RequireNumberSeparators)\npolicy has been disabled. We are working with phonenumbers, strings consisting primarily of number, so not special interpretation or calculative behaviour is needed.\n- [Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma](https://metacpan.org/pod/Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma) policy has been disabled. I like constants.\n- [Perl::Critic::Policy::InputOutput::RequireBracedFileHandleWithPrint](https://metacpan.org/pod/Perl::Critic::Policy::InputOutput::RequireBracedFileHandleWithPrint) policy has been disabled for now should be revisited at some point.\n\n# TODO\n\n- Please refer to the distribution TODO file\n\n# SEE ALSO\n\n- [sprintf](https://metacpan.org/pod/sprintf)\n\n    Business::DK::Phonenumber utilizes sprintf to as templating system for\n    formatting telephonenumbers. This is a well specified and tested interface\n    which is easy to use.\n\n- [Class::Business::DK::Phonenumber](https://metacpan.org/pod/Class::Business::DK::Phonenumber)\n\n    An OOP approach to regarding a Danish phone number as an object\n\n- [Data::FormValidator::Constraints::Business::DK::Phonenumber](https://metacpan.org/pod/Data::FormValidator::Constraints::Business::DK::Phonenumber)\n\n    Wrapper for integrating with [Data::FormValidator](https://metacpan.org/pod/Data::FormValidator)\n\n# BUG REPORTING\n\nPlease report issues via CPAN RT:\n\n[http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-DK-Phonenumber](http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-DK-Phonenumber)\n\nor by sending mail to\n\nbug-Business-DK-Phonenumber@rt.cpan.org\n\n# MOTIVATION\n\nI have been working in Telco for a long time. So validation and formatting of\ntelephone numbers is something I have seen at lot of. This module is an attempt\nto sort of consolidate the numerous different regular expression solutions\nI have seen scattered over large code bases.\n\n# AUTHOR\n\nJonas B. Nielsen, (jonasbn) - `\u003cjonasbn@cpan.org\u003e`\n\n# COPYRIGHT\n\nBusiness-DK-Phonenumber and related is (C) by Jonas B. Nielsen, (jonasbn) 2008-2014\n\n# LICENSE\n\nBusiness-DK-Phonenumber and related is released under the Artistic License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbn%2Fbdkphn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonasbn%2Fbdkphn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbn%2Fbdkphn/lists"}