![]() |
![]()
| ![]() |
![]()
NAMEIO::Socket::SSL::PublicSuffix - provide access to Mozilla's list of effective TLD names SYNOPSIS# use builtin default use IO::Socket::SSL::PublicSuffix; $ps = IO::Socket::SSL::PublicSuffix->default; # load from string $ps = IO::Socket::SSL::PublicSuffix->from_string("*.uk\n*"); # load from file or file handle $ps = IO::Socket::SSL::PublicSuffix->from_file($filename); $ps = IO::Socket::SSL::PublicSuffix->from_file(\*STDIN); # --- string in -> string out # $rest -> whatever.host # $tld -> co.uk my ($rest,$tld) = $ps->public_suffix('whatever.host.co.uk'); my $tld = $ps->public_suffix('whatever.host.co.uk'); # $root_domain -> host.co.uk my $root_domain = $ps->public_suffix('whatever.host.co.uk', 1); # --- array in -> array out # $rest -> [qw(whatever host)] # $tld -> [qw(co uk)] my ($rest,$tld) = $ps->public_suffix([qw(whatever host co uk)]); ---- # To update this file with the current list: perl -MIO::Socket::SSL::PublicSuffix -e 'IO::Socket::SSL::PublicSuffix::update_self_from_url()' DESCRIPTIONThis 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. Method
FILEShttp://publicsuffix.org/list/effective_tld_names.dat SEE ALSODomain::PublicSuffix, Mozilla::PublicSuffix BUGSQ: Why yet another module, we already have L<Domain::PublicSuffix> and L<Mozilla::PublicSuffix>. A: Because the public suffix data change more often than these modules do, IO::Socket::SSL needs this list and it is more easy this way to keep it up-to-date. AUTHORSteffen Ullrich
|