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, or undef if 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 with IO::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 Β© 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