25 Aug 2021 15:51:03 UTC
- Distribution: Mozilla-PublicSuffix
- Module version: v1.0.5
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- KwaliteeBus factor: 1
- 97.14% Coverage
- License: mit
- Perl: v5.8.0
- Activity24 month
- Download (84.97KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:1 non-PAUSE userTOMHUKINS Tom Hukinsand 2 contributors
- Tom Hukins
- Richard Simões <rsimoes AT cpan DOT org>
- SEE ALSO
- BUG REPORTS
- ORIGINAL AUTHOR
- CURRENT MAINTAINER
- COPYRIGHT & LICENSE
Mozilla::PublicSuffix - Get a domain name's public suffix via the Mozilla Public Suffix List
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
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.
Exported on request. Simply returns the public suffix of the passed domain name, or
undefif either the domain name is not well-formed or the public suffix is not found.
Similar to this module, with an object-oriented interface and somewhat alternative interpretation of the rules Mozilla stipulates for determining a public suffix.
IO::Socket::SSL, used by many HTTP client libraries for SSL/TLS support, and makes it easy to use the current version of the public suffix list at run-time.
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::PublicSuffix@rt.cpan.org.
<rsimoes AT cpan DOT org>
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.
Module Install Instructions
To install Mozilla::PublicSuffix, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Mozilla::PublicSuffix
For more information on module installation, please visit the detailed CPAN module installation guide.