| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyrights and documentation are after __END__. |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package POE; |
|
4
|
|
|
|
|
|
|
|
|
5
|
431
|
|
|
431
|
|
1153577
|
use strict; |
|
|
431
|
|
|
|
|
905
|
|
|
|
431
|
|
|
|
|
10915
|
|
|
6
|
386
|
|
|
386
|
|
65315
|
use Carp qw( croak ); |
|
|
386
|
|
|
|
|
747
|
|
|
|
386
|
|
|
|
|
15701
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
380
|
|
|
380
|
|
95081
|
use vars qw($VERSION); |
|
|
379
|
|
|
|
|
797
|
|
|
|
379
|
|
|
|
|
15211
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '1.367'; # NOTE - Should be #.### (three decimal places) |
|
10
|
|
|
|
|
|
|
|
|
11
|
267
|
|
|
267
|
|
128709
|
use POE::Resource::Clock qw( monotime time walltime sleep mono2wall wall2mono ); |
|
|
267
|
|
|
|
|
818
|
|
|
|
267
|
|
|
|
|
96019
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub import { |
|
14
|
351
|
|
|
351
|
|
86053
|
my $self = shift; |
|
15
|
|
|
|
|
|
|
|
|
16
|
351
|
|
|
|
|
1751
|
my @loops = grep(/^(?:XS::)?Loop::/, @_); |
|
17
|
351
|
|
|
|
|
1936
|
my @sessions = grep(/^(Session|NFA)$/, @_); |
|
18
|
345
|
|
|
|
|
3464
|
my @modules = grep(!/^(Kernel|Session|NFA|(?:XS::)?Loop::[\w:]+)$/, @_); |
|
19
|
|
|
|
|
|
|
|
|
20
|
345
|
100
|
|
|
|
1504
|
croak "can't use multiple event loops at once" |
|
21
|
|
|
|
|
|
|
if (@loops > 1); |
|
22
|
344
|
100
|
|
|
|
1518
|
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
|
|
|
|
1103
|
if (@sessions) { |
|
27
|
9
|
|
|
|
|
17
|
unshift @modules, @sessions; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
else { |
|
30
|
322
|
|
|
|
|
848
|
unshift @modules, 'Session'; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
326
|
|
|
|
|
1248
|
my $package = caller(); |
|
34
|
326
|
|
|
|
|
436
|
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
|
|
|
|
|
1154
|
my $loop = ""; |
|
|
321
|
|
|
|
|
606
|
|
|
42
|
321
|
100
|
|
|
|
1072
|
if (@loops) { |
|
43
|
3
|
|
|
|
|
7
|
$loop = "{ loop => '" . shift (@loops) . "' }"; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
321
|
|
|
|
|
1114
|
my $code = "package $package; use POE::Kernel $loop;"; |
|
46
|
|
|
|
|
|
|
# warn $code; |
|
47
|
248
|
|
|
248
|
|
208754
|
eval $code; |
|
|
248
|
|
|
22
|
|
895
|
|
|
|
248
|
|
|
|
|
2736
|
|
|
|
321
|
|
|
|
|
37760
|
|
|
48
|
321
|
100
|
|
|
|
1605
|
if ($@) { |
|
49
|
1
|
|
|
|
|
10
|
warn $@; |
|
50
|
1
|
|
|
|
|
6
|
push @failed, "Kernel" |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# Load all the others. |
|
55
|
|
|
|
|
|
|
|
|
56
|
321
|
|
|
|
|
861
|
foreach my $module (@modules) { |
|
57
|
990
|
|
|
|
|
3063
|
my $code = "package $package; use POE::$module;"; |
|
58
|
|
|
|
|
|
|
# warn $code; |
|
59
|
215
|
|
|
215
|
|
150799
|
eval($code); |
|
|
215
|
|
|
5
|
|
534
|
|
|
|
215
|
|
|
5
|
|
2112
|
|
|
|
990
|
|
|
|
|
93761
|
|
|
60
|
990
|
100
|
|
|
|
4925
|
if ($@) { |
|
61
|
1
|
|
|
|
|
13
|
warn $@; |
|
62
|
1
|
|
|
|
|
201
|
push(@failed, $module); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
321
|
100
|
|
|
|
236497
|
@failed and croak "could not import qw(" . join(' ', @failed) . ")"; |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |