line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OurNet::BBSApp::Monitor; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use vars qw/@blacklist @newblacklist/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
198
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub add { |
6
|
0
|
|
|
0
|
0
|
|
push @newblacklist, $_[0]; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub del { |
10
|
0
|
|
|
0
|
0
|
|
my $trg = shift; |
11
|
0
|
|
|
|
|
|
my @nl; |
12
|
0
|
|
|
|
|
|
foreach my $item (@blacklist) { |
13
|
0
|
0
|
|
|
|
|
push @nl, $item unless $item eq $trg; |
14
|
|
|
|
|
|
|
} |
15
|
0
|
|
|
|
|
|
@blacklist = @nl; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub process { |
19
|
0
|
|
|
0
|
0
|
|
foreach my $item (@newblacklist) { |
20
|
0
|
|
|
|
|
|
$item->refresh; |
21
|
0
|
|
|
|
|
|
push @blacklist, $item; |
22
|
0
|
|
|
|
|
|
$item->process; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
@newblacklist = (); |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
foreach my $item (@blacklist) { |
28
|
0
|
0
|
|
|
|
|
$item->process if $item->refresh; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |