Net::DAS - A simple DAS (Domain Availabilty Seach) client.
# new object my $das = Net::DAS->new(); # you can change query timeout, set to use registrar DAS servers (where available), select only specific modules, and override the requst function (normally for testing) my $das = Net::DAS->new({timeout=>2,use_registrar=>1,modules=>['eu','be'],_request=>\&my_request}); # lookup() always works in batch mode, so if you are only looking up a single domain you can access that domains result directly my $res =$das->lookup('test.eu')->{'test.eu'}; if ($res->{'avail'}) { # do something } else { print $res->{'reason'}; } # or with multiple domains my $res =$das->lookup('test.eu','test2.eu','test3.eu'); print $res->{'test2.eu'}->{'reason'};
Net::DAS is a client that aims to simplify using DAS with multiple registries by having small submodules (see Net::DAS::*) to iron out the differences in the servers. It also inclused a shell script Net::DAS::das to do lookups from the command line.
Accepts a hash reference with available options being timeout (integer default 4), use_registrar (bool default 0), modules (array_ref default all), _request (sub - only used for overriding request method for testing)
my $das = Net::DAS->new(); my $das = Net::DAS->new({timeout=>2,use_registrar=>1,modules=>['eu','be'],_request=>\&my_request});
Lookup domain availability in batch mode. You can specify 1 or more domains, but always works in batch mode, so if you are only looking up a single domain you can access that domains result directly by using the domain name as a reference. When looking up multiple domains, just send an array and the return will be a hashref with the domain names as the keys
my $res =$das->lookup('test.eu')->{'test.eu'}; if ($res->{'avail'}) { # do something } else { print $res->{'reason'}; } # or with multiple domains my $res =$das->lookup('test.eu','test2.eu','test3.eu'); my $res =$das->lookup(@domains); print $res->{'test2.eu'}->{'reason'};
A quick function to lookup availability of a single domain without details. Warning, you should check if the result == 1, as there are different return codes.
print "available" if $das->availabile('test.eu')==1;
Michael Holloway <michael@thedarkwinter.com>
Artistic License
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install Net::DAS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::DAS
CPAN shell
perl -MCPAN -e shell install Net::DAS
For more information on module installation, please visit the detailed CPAN module installation guide.