blib/lib/IO/Async/Resolver/DNS/LibResolvImpl.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 SCAR 0.1
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/IO/Async/Resolver/DNS/NetDNSImpl.pm ↑ Summary
1 # You may distribute under the terms of either the GNU General Public License
2 # or the Artistic License (the same terms as Perl itself)
3 #
4 # (C) Paul Evans, 2011 -- leonerd@leonerd.org.uk
5  
6 package IO::Async::Resolver::DNS::LibResolvImpl;
7  
8 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 our $VERSION = '0.04';
12  
13 2 ▶use Net::LibResolv 0.03 qw( res_query res_search class_name2value type_name2value $h_errno );
Subroutine BEGIN: called CC=1 SCAR=2.6
14  
15 sub _resolve
16 {
17 my ( $func, $dname, $class, $type ) = @_;
18 my $pkt = $func->( $dname, class_name2value($class), type_name2value($type) );
19 # We can't easily detect NODATA errors here, so we'll have to let the
20 # higher-level function do it
21 die "$h_errno\n" if !defined $pkt;
22 return $pkt;
23 }
24  
25 sub IO::Async::Resolver::DNS::res_query { _resolve( \&res_query, @_ ) }
26 sub IO::Async::Resolver::DNS::res_search { _resolve( \&res_search, @_ ) }
27  
28 0x55AA;
« blib/lib/IO/Async/Resolver/DNS/NetDNSImpl.pm ↑ Summary