{"id":6628,"date":"2022-12-20T19:19:27","date_gmt":"2022-12-20T22:19:27","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/iosocketsslpublicsuffix-man3\/"},"modified":"2022-12-20T19:19:27","modified_gmt":"2022-12-20T22:19:27","slug":"iosocketsslpublicsuffix-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/iosocketsslpublicsuffix-man3\/","title":{"rendered":"IO::Socket::SSL::PublicSuffix (man3)"},"content":{"rendered":"<h1 align=\"center\">IO::Socket::SSL::PublicSuffix<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">IO::Socket::SSL::PublicSuffix \u2212 provide access to Mozilla\u2019s list of effective TLD names<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"># use builtin default <br \/> use IO::Socket::SSL::PublicSuffix; <br \/> $ps = IO::Socket::SSL::PublicSuffix\u2212>default; <br \/> # load from string <br \/> $ps = IO::Socket::SSL::PublicSuffix\u2212>from_string(&#8220;*.ukn*&#8221;); <br \/> # load from file or file handle <br \/> $ps = IO::Socket::SSL::PublicSuffix\u2212>from_file($filename); <br \/> $ps = IO::Socket::SSL::PublicSuffix\u2212>from_file(*STDIN); <br \/> # \u2212\u2212\u2212 string in \u2212> string out <br \/> # $rest \u2212> whatever.host <br \/> # $tld \u2212> co.uk <br \/> my ($rest,$tld) = $ps\u2212>public_suffix(&#8216;whatever.host.co.uk&#8217;); <br \/> my $tld = $ps\u2212>public_suffix(&#8216;whatever.host.co.uk&#8217;); <br \/> # $root_domain \u2212> host.co.uk <br \/> my $root_domain = $ps\u2212>public_suffix(&#8216;whatever.host.co.uk&#8217;, 1); <br \/> # \u2212\u2212\u2212 array in \u2212> array out <br \/> # $rest \u2212> [qw(whatever host)] <br \/> # $tld \u2212> [qw(co uk)] <br \/> my ($rest,$tld) = $ps\u2212>public_suffix([qw(whatever host co uk)]); <br \/> \u2212\u2212\u2212\u2212 <br \/> # To update this file with the current list: <br \/> perl \u2212MIO::Socket::SSL::PublicSuffix \u2212e &#8216;IO::Socket::SSL::PublicSuffix::update_self_from_url()&#8217;<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This module uses the list of effective top level domain names from the mozilla project to determine the public top level domain for a given hostname.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Method<\/b> <br \/> class\u2212>default(%args)<\/p>\n<p style=\"margin-left:17%;\">Returns object with builtin default. &#8220;min_suffix&#8221; can be given in %args to specify the minimal suffix, default is 1.<\/p>\n<p style=\"margin-left:11%;\">class\u2212>from_string(string,%args)<\/p>\n<p style=\"margin-left:17%;\">Returns object with configuration from string. See method &#8220;default&#8221; for %args.<\/p>\n<p style=\"margin-left:11%;\">class\u2212>from_file( file name| file handle, %args )<\/p>\n<p style=\"margin-left:17%;\">Returns object with configuration from file or file handle. See method &#8220;default&#8221; for %args.<\/p>\n<p style=\"margin-left:11%;\">$self\u2212>public_suffix( $host|@host, [ $add ] )<\/p>\n<p style=\"margin-left:17%;\">In array context the function returns the non-tld part and the tld part of the given hostname, in scalar context only the tld part. It adds $add parts of the non-tld part to the tld, e.g. with &#8220;$add=1&#8221; it will return the root domain.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If there were no explicit matches against the public suffix configuration it will fall back to a suffix of length 1.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The function accepts a string or an array-ref (e.g. host split by &#8220;.&#8221;). In the first case it will return string(s), in the latter case array\u2212ref(s).<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">International hostnames or labels can be in <small>ASCII<\/small> ( <small>IDNA<\/small> form starting with &#8220;xn\u2212\u2212&#8221;) or unicode. In the latter case an <small>IDNA<\/small> handling library like Net::IDN:::Encode, Net::LibIDN or recent versions of <small>URI<\/small> need to be installed.<\/p>\n<p style=\"margin-left:11%;\">($self|class)\u2212>can_idn<\/p>\n<p style=\"margin-left:17%;\">Returns true if <small>IDN<\/small> support is available.<\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">http:\/\/publicsuffix.org\/list\/effective_tld_names.dat<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Domain::PublicSuffix, Mozilla::PublicSuffix<\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Q: Why yet another module, we already have L<Domain::PublicSuffix> and <br \/> L<Mozilla::PublicSuffix>. <br \/> A: Because the public suffix data change more often than these modules do, <br \/> IO::Socket::SSL needs this list and it is more easy this way to keep it <br \/> up\u2212to\u2212date.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Steffen Ullrich<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  IO::Socket::SSL::PublicSuffix \u2212 provide access to Mozilla\u2019s list of effective TLD names <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3009,3007],"class_list":["post-6628","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-iosocketsslpublicsuffix","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6628"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6628\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}