| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyrights and documentation are after __END__. |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package POE; |
|
4
|
|
|
|
|
|
|
|
|
5
|
431
|
|
|
431
|
|
1042808
|
use strict; |
|
|
431
|
|
|
|
|
796
|
|
|
|
431
|
|
|
|
|
9277
|
|
|
6
|
386
|
|
|
386
|
|
65428
|
use Carp qw( croak ); |
|
|
386
|
|
|
|
|
665
|
|
|
|
386
|
|
|
|
|
12861
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
380
|
|
|
380
|
|
34499
|
use vars qw($VERSION); |
|
|
379
|
|
|
|
|
639
|
|
|
|
379
|
|
|
|
|
14173
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '1.365'; # NOTE - Should be #.### (three decimal places) |
|
10
|
|
|
|
|
|
|
|
|
11
|
267
|
|
|
267
|
|
105782
|
use POE::Resource::Clock qw( monotime time walltime sleep mono2wall wall2mono ); |
|
|
267
|
|
|
|
|
596
|
|
|
|
267
|
|
|
|
|
69503
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub import { |
|
14
|
351
|
|
|
351
|
|
72861
|
my $self = shift; |
|
15
|
|
|
|
|
|
|
|
|
16
|
351
|
|
|
|
|
1425
|
my @loops = grep(/^(?:XS::)?Loop::/, @_); |
|
17
|
351
|
|
|
|
|
1557
|
my @sessions = grep(/^(Session|NFA)$/, @_); |
|
18
|
345
|
|
|
|
|
2805
|
my @modules = grep(!/^(Kernel|Session|NFA|(?:XS::)?Loop::[\w:]+)$/, @_); |
|
19
|
|
|
|
|
|
|
|
|
20
|
345
|
100
|
|
|
|
1182
|
croak "can't use multiple event loops at once" |
|
21
|
|
|
|
|
|
|
if (@loops > 1); |
|
22
|
344
|
100
|
|
|
|
1292
|
croak "POE::Session and POE::NFA export conflicting constants" |
|
23
|
|
|
|
|
|
|
if scalar @sessions > 1; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# If a session was specified, use that. Otherwise use Session. |
|
26
|
326
|
100
|
|
|
|
850
|
if (@sessions) { |
|
27
|
9
|
|
|
|
|
13
|
unshift @modules, @sessions; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
else { |
|
30
|
322
|
|
|
|
|
816
|
unshift @modules, 'Session'; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
326
|
|
|
|
|
1072
|
my $package = caller(); |
|
34
|
326
|
|
|
|
|
390
|
my @failed; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# Load POE::Kernel in the caller's package. This is separate |
|
37
|
|
|
|
|
|
|
# because we need to push POE::Loop classes through POE::Kernel's |
|
38
|
|
|
|
|
|
|
# import(). |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
{ |
|
41
|
326
|
|
|
|
|
461
|
my $loop = ""; |
|
|
321
|
|
|
|
|
377
|
|
|
42
|
321
|
100
|
|
|
|
928
|
if (@loops) { |
|
43
|
3
|
|
|
|
|
8
|
$loop = "{ loop => '" . shift (@loops) . "' }"; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
321
|
|
|
|
|
970
|
my $code = "package $package; use POE::Kernel $loop;"; |
|
46
|
|
|
|
|
|
|
# warn $code; |
|
47
|
248
|
|
|
248
|
|
182432
|
eval $code; |
|
|
248
|
|
|
22
|
|
716
|
|
|
|
248
|
|
|
|
|
2266
|
|
|
|
321
|
|
|
|
|
18292
|
|
|
48
|
321
|
100
|
|
|
|
1278
|
if ($@) { |
|
49
|
1
|
|
|
|
|
9
|
warn $@; |
|
50
|
1
|
|
|
|
|
8
|
push @failed, "Kernel" |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# Load all the others. |
|
55
|
|
|
|
|
|
|
|
|
56
|
321
|
|
|
|
|
757
|
foreach my $module (@modules) { |
|
57
|
990
|
|
|
|
|
2543
|
my $code = "package $package; use POE::$module;"; |
|
58
|
|
|
|
|
|
|
# warn $code; |
|
59
|
215
|
|
|
215
|
|
100876
|
eval($code); |
|
|
215
|
|
|
5
|
|
480
|
|
|
|
215
|
|
|
5
|
|
1666
|
|
|
|
990
|
|
|
|
|
52666
|
|
|
60
|
990
|
100
|
|
|
|
3995
|
if ($@) { |
|
61
|
1
|
|
|
|
|
9
|
warn $@; |
|
62
|
1
|
|
|
|
|
4
|
push(@failed, $module); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
321
|
100
|
|
|
|
220854
|
@failed and croak "could not import qw(" . join(' ', @failed) . ")"; |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |