line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/local/bin/perl -w |
2
|
|
|
|
|
|
|
###################################################################### |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# DNS/Config.pm |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# $Id: Config.pm,v 1.4 2003/02/16 10:15:31 awolf Exp $ |
7
|
|
|
|
|
|
|
# $Revision: 1.4 $ |
8
|
|
|
|
|
|
|
# $Author: awolf $ |
9
|
|
|
|
|
|
|
# $Date: 2003/02/16 10:15:31 $ |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# Copyright (C)2001-2003 Andy Wolf. All rights reserved. |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# This library is free software; you can redistribute it and/or |
14
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
###################################################################### |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
package DNS::Config; |
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
828
|
no warnings 'portable'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
89
|
|
21
|
2
|
|
|
2
|
|
28
|
use 5.6.0; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
86
|
|
22
|
2
|
|
|
2
|
|
22
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
76
|
|
23
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
788
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $VERSION = '0.66'; |
26
|
|
|
|
|
|
|
my $REVISION = sprintf("%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub new { |
29
|
1
|
|
|
1
|
0
|
3
|
my($pkg) = @_; |
30
|
1
|
|
33
|
|
|
5
|
my $class = ref($pkg) || $pkg; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
3
|
my $self = { |
33
|
|
|
|
|
|
|
'STATEMENTS' => [] |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
2
|
bless $self, $class; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
4
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub add { |
42
|
1
|
|
|
1
|
0
|
2
|
my($self, $statement) = @_; |
43
|
|
|
|
|
|
|
|
44
|
1
|
50
|
|
|
|
4
|
if(ref($statement) eq 'ARRAY') { |
45
|
0
|
|
|
|
|
0
|
push @{ $self->{'STATEMENTS'} }, @$statement; |
|
0
|
|
|
|
|
0
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
else { |
48
|
1
|
|
|
|
|
2
|
push @{ $self->{'STATEMENTS'} }, ($statement); |
|
1
|
|
|
|
|
5
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
1
|
|
|
|
|
7
|
return $self; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub delete { |
55
|
0
|
|
|
0
|
0
|
|
my($self, $statement) = @_; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
for(my $i=0 ; $i < scalar @{$self->{'STATEMENTS'}} ; $i++) { |
|
0
|
|
|
|
|
|
|
58
|
0
|
0
|
|
|
|
|
next unless( defined( $self->{'STATEMENTS'}->[$i] ) ); |
59
|
0
|
0
|
|
|
|
|
splice @{ $self->{'STATEMENTS'} }, $i, 1 if($self->{'STATEMENTS'}->[$i] == $statement); |
|
0
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
return $self; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub debug { |
66
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
eval { |
69
|
2
|
|
|
2
|
|
1276
|
use Data::Dumper; |
|
2
|
|
|
|
|
8123
|
|
|
2
|
|
|
|
|
437
|
|
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
print Dumper($self); |
72
|
|
|
|
|
|
|
}; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
return; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub statements { |
78
|
0
|
|
|
0
|
0
|
|
my($self, $type) = @_; |
79
|
0
|
|
|
|
|
|
my @result; |
80
|
|
|
|
|
|
|
|
81
|
0
|
0
|
|
|
|
|
if($type) { |
82
|
0
|
|
|
|
|
|
foreach (@{ $self->{'STATEMENTS'} }) { |
|
0
|
|
|
|
|
|
|
83
|
0
|
0
|
|
|
|
|
push @result, $_ if(ref($_) eq $type); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
else { |
87
|
0
|
|
|
|
|
|
@result = @{ $self->{'STATEMENTS'} }; |
|
0
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
0
|
|
|
|
|
|
return @result; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
__END__ |