File Coverage

blib/lib/Net/DAS/SE.pm
Criterion Covered Total %
statement 16 17 94.1
branch 3 4 75.0
condition n/a
subroutine 6 6 100.0
pod 0 3 0.0
total 25 30 83.3


line stmt bran cond sub pod time code
1             package Net::DAS::SE;
2 2     2   1189 use 5.010;
  2         38  
  2         112  
3 2     2   11 use strict;
  2         2  
  2         66  
4 2     2   10 use warnings;
  2         2  
  2         352  
5              
6             sub register {
7             return {
8 1     1 0 7 tlds => [qw(se)],
9             public => {
10             host => 'free.iis.se',
11             port => 80,
12             },
13             dispatch => [\&query, \&parse],
14              
15             };
16             }
17              
18             sub query {
19 4     4 0 5 my $d = shift;
20 4         15 return "GET /free?q=$d HTTP/1.1\n".
21             "host: free.iis.se\n\n";
22              
23             }
24              
25             sub parse {
26 4     4 0 8 chomp (my $i = uc(shift));
27 4         5 chomp (my $dn = uc(shift));
28 4 100       37 return 1 if uc($i) =~ m/FREE $dn/;
29 2 50       23 return 0 if uc($i) =~ m/OCCUPIED $dn/;
30 0           return (-100) ;
31             }
32              
33             1;
34              
35             =pod
36              
37             =head1 NAME
38              
39             Net::DAS::SE - Net::DAS .SE extension.
40              
41             See L
42              
43             =head1 AUTHOR
44              
45             Michael Holloway
46              
47             =head1 LICENSE
48              
49             Artistic License
50              
51             =cut