line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights and documentation are after __END__. |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package POE; |
4
|
|
|
|
|
|
|
|
5
|
434
|
|
|
434
|
|
987745
|
use strict; |
|
434
|
|
|
|
|
711
|
|
|
434
|
|
|
|
|
8390
|
|
6
|
389
|
|
|
389
|
|
61825
|
use Carp qw( croak ); |
|
389
|
|
|
|
|
637
|
|
|
389
|
|
|
|
|
13038
|
|
7
|
|
|
|
|
|
|
|
8
|
383
|
|
|
383
|
|
30878
|
use vars qw($VERSION); |
|
382
|
|
|
|
|
574
|
|
|
382
|
|
|
|
|
12405
|
|
9
|
|
|
|
|
|
|
$VERSION = '1.366'; # NOTE - Should be #.### (three decimal places) |
10
|
|
|
|
|
|
|
|
11
|
269
|
|
|
269
|
|
101260
|
use POE::Resource::Clock qw( monotime time walltime sleep mono2wall wall2mono ); |
|
269
|
|
|
|
|
613
|
|
|
269
|
|
|
|
|
66511
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub import { |
14
|
353
|
|
|
353
|
|
67190
|
my $self = shift; |
15
|
|
|
|
|
|
|
|
16
|
353
|
|
|
|
|
1330
|
my @loops = grep(/^(?:XS::)?Loop::/, @_); |
17
|
353
|
|
|
|
|
1717
|
my @sessions = grep(/^(Session|NFA)$/, @_); |
18
|
347
|
|
|
|
|
2705
|
my @modules = grep(!/^(Kernel|Session|NFA|(?:XS::)?Loop::[\w:]+)$/, @_); |
19
|
|
|
|
|
|
|
|
20
|
347
|
100
|
|
|
|
1180
|
croak "can't use multiple event loops at once" |
21
|
|
|
|
|
|
|
if (@loops > 1); |
22
|
346
|
100
|
|
|
|
1190
|
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
|
328
|
100
|
|
|
|
836
|
if (@sessions) { |
27
|
9
|
|
|
|
|
12
|
unshift @modules, @sessions; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
else { |
30
|
324
|
|
|
|
|
727
|
unshift @modules, 'Session'; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
328
|
|
|
|
|
895
|
my $package = caller(); |
34
|
328
|
|
|
|
|
368
|
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
|
328
|
|
|
|
|
413
|
my $loop = ""; |
|
323
|
|
|
|
|
406
|
|
42
|
323
|
100
|
|
|
|
894
|
if (@loops) { |
43
|
3
|
|
|
|
|
7
|
$loop = "{ loop => '" . shift (@loops) . "' }"; |
44
|
|
|
|
|
|
|
} |
45
|
323
|
|
|
|
|
1112
|
my $code = "package $package; use POE::Kernel $loop;"; |
46
|
|
|
|
|
|
|
# warn $code; |
47
|
250
|
|
|
250
|
|
174774
|
eval $code; |
|
250
|
|
|
22
|
|
638
|
|
|
250
|
|
|
|
|
2222
|
|
|
323
|
|
|
|
|
17643
|
|
48
|
323
|
100
|
|
|
|
1438
|
if ($@) { |
49
|
1
|
|
|
|
|
8
|
warn $@; |
50
|
1
|
|
|
|
|
5
|
push @failed, "Kernel" |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# Load all the others. |
55
|
|
|
|
|
|
|
|
56
|
323
|
|
|
|
|
652
|
foreach my $module (@modules) { |
57
|
999
|
|
|
|
|
2433
|
my $code = "package $package; use POE::$module;"; |
58
|
|
|
|
|
|
|
# warn $code; |
59
|
217
|
|
|
217
|
|
99081
|
eval($code); |
|
217
|
|
|
5
|
|
575
|
|
|
217
|
|
|
5
|
|
1454
|
|
|
999
|
|
|
|
|
49730
|
|
60
|
999
|
100
|
|
|
|
3848
|
if ($@) { |
61
|
1
|
|
|
|
|
11
|
warn $@; |
62
|
1
|
|
|
|
|
3
|
push(@failed, $module); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
323
|
100
|
|
|
|
214177
|
@failed and croak "could not import qw(" . join(' ', @failed) . ")"; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |