|
NAMEIO::Lambda::DNS - DNS queries lambda style DESCRIPTIONThe module provides access to asynchronous DNS queries through Net::DNS. Two function doing the same operation are featured: constructor "new" and condition "dns". SYNOPSIS use strict;
use IO::Lambda::DNS qw(:all);
use IO::Lambda qw(:all);
# simple async query
my $reply = IO::Lambda::DNS-> new( "www.site.com" )-> wait;
print (($reply =~ /^\d/) ? "Resolved to $reply\n" : "Error: $reply\n");
# parallel async queries
lambda {
for my $site ( map { "www.$_.com" } qw(google yahoo perl)) {
context $site, 'MX', timeout => 0.25;
dns { print shift-> string if ref($_[0]) }
}
}-> wait;
OPTIONSAccepted options specific to the module are "timeout" or "deadline" (in seconds) and "retry" (in times). All other options, such as "nameservers", "dnssec" etc etc are passed as is to the "Net::DNS::Resolver" constructor. See its man page for details. USAGE
SEE ALSOIO::Lambda, Net::DNS::Resolver. AUTHORDmitry Karasik, <dmitry@karasik.eu.org>.
|