The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Build Status CPAN version

NAME

No::OrgNr - Utility functions for Norwegian organizations' ID numbers

VERSION

This document describes No::OrgNr version 0.9.3

SYNOPSIS

    use No::OrgNr qw/domain2orgnr num_domains orgnr2domains orgnr_ok/;
    # or
    use No::OrgNr qw/:all/;

    my $owner   = domain2orgnr('google.no'); # Returns "988588261", as seen by Whois
    my $num     = num_domains(ORG_NR);       # Returns the number of domain names owned by ORG_NR
    my $orgnr   = orgnr_ok('988588261');     # Returns "988 588 261"
    my @domains = orgnr2domains(ORG_NR);     # Returns a list of domain names owned by ORG_NR

DESCRIPTION

Organizations in Norway have a 9-digit number for identification. Valid numbers start on 8 or 9. No information about the given organization can be derived from the number.

This module contains utility functions for handling these numbers.

Please keep in mind that this module utilizes the module Net::Whois::Norid, which in turn uses the server whois.norid.no. This server has a limitation for the number of requests. See documentation at https://www.norid.no/en/registrar/system/tjenester/whois-das-service/.

The Norwegian term for organization number is "organisasjonsnummer". See https://no.wikipedia.org/wiki/Organisasjonsnummer for a description (Norwegian text only).

Organizations in other countries have ID numbers as well. See https://en.wikipedia.org/wiki/VAT_identification_number.

SUBROUTINES/METHODS

Nothing is exported by default. See "SYNOPSIS" above.

domain2orgnr(DOMAIN_NAME)

The function returns the organization number for the owner of DOMAIN_NAME. Only Norwegian domain names (*.no) are supported. If no organization number can be found, the undefined value is returned.

num_domains(ORG_NR)

The function returns the number of domain names owned by organization number ORG_NR. The value is zero if no such domain name exists.

orgnr2domains(ORG_NR)

The function returns a sorted list of domain names (if any) owned by organization number ORG_NR. If ORG_NR is missing or invalid, or the organization does not own a domain name, an empty list is returned.

orgnr_ok(ORG_NR)

The function returns false if ORG_NR is invalid. Otherwise, it returns the number in standard form, e.g., "987 654 321", which of course is a true value. A valid number is not necessarily used by any real organization.

DIAGNOSTICS

None.

CONFIGURATION

None.

DEPENDENCIES

This module requires Perl 5.14 or later, due to the "/a" regular expression modifier.

INCOMPATIBILITIES

None reported.

SEE ALSO

The modules No::KontoNr and No::PersonNr, written by another CPAN author, may be of interest for validation purposes. The documentation for these modules is in Norwegian only.

BUGS

Please report bugs using GitHub.

SUPPORT

Documentation for this module is available using the following command:

    perldoc No::OrgNr

The following sites may be useful:

AUTHOR

Geir Myklebust <geirmy@cpan.org>

COPYRIGHT AND LICENSE

No::OrgNr is Copyright (C) 2015, 2016, Geir Myklebust.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl 5.14.0. For details, see GNU General Public License and Perl Artistic License.

This program is distributed in the hope that it will be useful, but it is provided "as is" and without any express or implied warranties.