Ricardo SIGNES > Net-Domain-TLD-1.62 > Net::Domain::TLD

Download:
Net-Domain-TLD-1.62.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  2
View/Report Bugs
Module Version: 1.62   Source  

NAME ^

Net::Domain::TLD - look up and validate TLDs

VERSION ^

version 1.62

 $Id$

SYNOPSIS ^

 use Net::Domain::TLD qw(tlds);

 my @ccTLDs = tlds('cc');

DESCRIPTION ^

The purpose of this module is to provide user with current list of available top level domain names including new ICANN additions and ccTLDs

PUBLIC INTERFACES ^

Versions prior to 1.60 were intended for use as objects. The objects carried no data, so this was not useful. There was no class-based configuration, either, so class methods would not be a useful interface. You can still use the old interface, but the suggested interface is procedural.

PROCEDURAL INTERFACE

tlds

 my @all_tlds = tlds;
 my @cc_tlds  = tlds('cc');
 my @cc_tlds  = tlds('cc', 'generic');

 my $tld = tlds;

In list context, this routine returns a list of TLDs of the requested type. If no type is given, all known TLDs are returned. The list consists of strings.

In scalar context, this routine returns a reference to a hash of TLDs and their descriptions.

Valid groups are:

 cc                 - country code TLDs
 gtld_open          - generic TLDs that anyone can register
 gtld_restricted    - generic TLDs with restricted registration
 gtld_new           - the horrible, recently added generic TLDs
 gtld               - all of the above gtld groups

tld_exists

  die "no such domain" unless tld_exists($tld);

This routine returns true if the given domain exists and false if it does not.

OO INTERFACE

The object-oriented interface is clunky and unneeded. Don't use it.

new

 my $tld = Net::Domain::TLD->new;

This method, which creates a new Net::Domain::TLD object, is deprecated. Use the procedural interface instead.

All

 my @list = $tld->All;
 # equivalent to:
 my @list = tld;

TLDs_new

 my @list = $tld->TLDs_new;
 # equivalent to:
 my @list = tld('new');

gTLDs_open

 my $tld = $tld->gTLDs_open;
 # equivalent to:
 my $tld = tld('gtld_open');

gTLDs_restricted

 my @list = $tld->gTLDs_restricted;
 # equivalent to:
 my @list = tld('gtld_restricted');

ccTLDs

 my $tld = $tld->ccTLDs;
 # equivalent to:
 my $tld = tld('cc');

exists

 print $tld->exists(q{info}) ? q{ok} : q{not ok};
 # equivalent to:
 print tld_exists(q{info}) ? q{ok} : q{not ok};

COPYRIGHT ^

Copyright (c) 2003-2005 Alexander Pavlovic, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS ^

Alexander Pavlovic <alex-1@telus.net>

Ricardo SIGNES <rjbs@cpan.org>

syntax highlighting: