Mozill...cSuffix(3pm)
π NAME π
Mozilla::PublicSuffix β bestie, this is how you get a domain name's public suffix, pulled straight from the Mozilla Public Suffix List. (You'll also see this page filed under the manual name Mozill...cSuffix(3pm) β same girl, same energy.)
β¨ SYNOPSIS β¨
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
π¦ DESCRIPTION π¦
Okay so this module gives you literally one function, and what it does is hand you back the public suffix of a domain name. How? By referencing a parsed copy of Mozilla's Public Suffix List. No cap. π
Straight 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 right there with the distribution, which is giving convenience π
. But here's the thing β the official list keeps getting updated, so the bundled copy will inevitably fall out of date. Not a vibe, we know. So aside from new releases always shipping the latest version of the list, this distribution's installer gives you the option to check for a new version of the list and download/use it if one is found. And that option? It defaults to "No". π
π FUNCTIONS π
public_suffix($domain)β Exported on request π«Ά. It simply returns the public suffix of the domain name you passed in, orundefif either the domain name is not well-formed or the public suffix is not found. That's it, that's the whole function. Iconic.
πΈ SEE ALSO πΈ
Domain::PublicSuffixβ Similar to this module, except it's got an object-oriented interface and a somewhat alternative interpretation of the rules Mozilla stipulates for determining a public suffix. Different path, same destination energy.IO::Socket::SSL::PublicSuffixβ Ships withIO::Socket::SSL, which is used by many HTTP client libraries for SSL/TLS support, and it makes it easy to use the current version of the public suffix list at run-time. Lowkey handy.
π BUG REPORTS π
Please submit bug reports to:
https://rt.cpan.org/Public/Dist/Display.html?Name=Mozilla::PublicSuffix
And if you would like to send patches, please send a git pull request to:
mailto:bug-Mozilla::PublicSuffix@rt.cpan.org
Not me begging you to file the bug instead of just suffering in silence π please do it, the maintainers want to hear from you.
π ORIGINAL AUTHOR π
Richard SimΓ΅es "<rsimoes AT cpan DOT org>" β the original main character, we stan. β¨
π§ CURRENT MAINTAINER π§
Tom Hukins
π COPYRIGHT & LICENSE π
Copyright Β© 2013 Richard SimΓ΅es. This module is released under the terms of the MIT License and may be modified and/or redistributed under the same or any compatible license.
That's the whole page, bestie! π This one's from the User Contributed Perl Documentation, running under perl v5.40.0, dated 2024-08-26, filed under the manual name Mozill...cSuffix(3pm). Periodt. π
π
π¦ where this page comes from
- ubuntu resolute: libmozilla-publicsuffix-perl 1.0.7-1 Β· MIT/X11
- ubuntu stonking: libmozilla-publicsuffix-perl 1.0.7-1 Β· MIT/X11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms