line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::New::Queue; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
26362
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
153
|
|
4
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
946
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $QUEUE = []; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub localize { |
9
|
16
|
|
|
16
|
1
|
39
|
my ($class, $code) = @_; |
10
|
|
|
|
|
|
|
|
11
|
16
|
|
|
|
|
27
|
local $QUEUE = []; |
12
|
16
|
|
|
|
|
49
|
$code->(); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub register { |
16
|
91
|
|
|
91
|
1
|
508
|
my ($class, $code) = @_; |
17
|
|
|
|
|
|
|
|
18
|
91
|
|
|
|
|
94
|
push @{ $QUEUE }, $code; |
|
91
|
|
|
|
|
259
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub consume { |
22
|
26
|
|
|
26
|
1
|
49
|
my ($class, @args) = @_; |
23
|
|
|
|
|
|
|
|
24
|
26
|
|
|
|
|
38
|
while ( my $func = shift @{ $QUEUE } ) { |
|
100
|
|
|
|
|
1087
|
|
25
|
74
|
|
|
|
|
184
|
$func->( @args ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
6
|
|
|
6
|
1
|
1260
|
sub queue { @{ $QUEUE } } |
|
6
|
|
|
|
|
19
|
|
30
|
2
|
|
|
2
|
1
|
2517
|
sub clear { $QUEUE = [] } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |