Mozilla::PublicSuffix(3pm)

Mozilla::PublicSuffix3pm

Get a domain name's public suffix via the mozilla public suffix list

Usage

    use feature qw(say);
    use Mozilla::PublicSuffix qw(public_suffix);
    say public_suffix('org');       # 'org'
    say public_suffix('perl.org');  # 'org'
    say public_suffix('perl.orc');  # undef
    say public_suffix('ga.gov.au'); # 'gov.au'
    say public_suffix('ga.goo.au'); # undef

Overview

This module provides a single function that returns the public suffix of a domain name by referencing a parsed copy of Mozilla's Public Suffix List. From the official website at <http://publicsuffix.org/>:

A "public suffix" is one under which Internet users can directly register names. Some examples of public suffixes are com, co.uk and pvt.k12.wy.us. The Public Suffix List is a list of all known public suffixes.

A copy of the official list is bundled with the distribution. As the official list continues to be updated, the bundled copy will inevitably fall out of date. Aside from new releases always including the latest version of the list, this distribution's installer provides the option (defaults to "No") to check for a new version of the list and download/use it if one is found.

Functions

public_suffix($domain)

Exported on request. Simply returns the public suffix of the passed domain name, or "undef" if either the domain name is not well-formed or the public suffix is not found.

Original author

Richard Simões "<rsimoes AT cpan DOT org>"

Current maintainer

Tom Hukins

Bug reports

Please submit bug reports to <https://rt.cpan.org/Public/Dist/Display.html?Name=Mozilla::PublicSuffix>.

If you would like to send patches, please send a git pull request to <mailto:bug-Mozilla::[email protected]>.

From libmozilla-publicsuffix-perl 1.0.7-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.