line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::New::Queue;
|
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
12218
|
use strict;
|
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
118
|
|
4
|
4
|
|
|
4
|
|
13
|
use warnings;
|
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
670
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $QUEUE = [];
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub localize {
|
9
|
16
|
|
|
16
|
1
|
25
|
my ($class, $code) = @_;
|
10
|
|
|
|
|
|
|
|
11
|
16
|
|
|
|
|
22
|
local $QUEUE = [];
|
12
|
16
|
|
|
|
|
35
|
$code->();
|
13
|
|
|
|
|
|
|
}
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub register {
|
16
|
93
|
|
|
93
|
1
|
372
|
my ($class, $code) = @_;
|
17
|
|
|
|
|
|
|
|
18
|
93
|
|
|
|
|
72
|
push @{ $QUEUE }, $code;
|
|
93
|
|
|
|
|
188
|
|
19
|
|
|
|
|
|
|
}
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub consume {
|
22
|
26
|
|
|
26
|
1
|
44
|
my ($class, @args) = @_;
|
23
|
|
|
|
|
|
|
|
24
|
26
|
|
|
|
|
25
|
while ( my $func = shift @{ $QUEUE } ) {
|
|
100
|
|
|
|
|
745
|
|
25
|
74
|
|
|
|
|
142
|
$func->( @args );
|
26
|
|
|
|
|
|
|
}
|
27
|
|
|
|
|
|
|
}
|
28
|
|
|
|
|
|
|
|
29
|
6
|
|
|
6
|
1
|
799
|
sub queue { @{ $QUEUE } }
|
|
6
|
|
|
|
|
11
|
|
30
|
2
|
|
|
2
|
1
|
1861
|
sub clear { $QUEUE = [] }
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1;
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__
|