| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyrights and documentation are after __END__. |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package POE; |
|
4
|
|
|
|
|
|
|
|
|
5
|
463
|
|
|
463
|
|
28939687
|
use strict; |
|
|
463
|
|
|
|
|
896
|
|
|
|
463
|
|
|
|
|
9898
|
|
|
6
|
417
|
|
|
417
|
|
71565
|
use Carp qw( croak ); |
|
|
417
|
|
|
|
|
990
|
|
|
|
417
|
|
|
|
|
13774
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
411
|
|
|
411
|
|
33081
|
use vars qw($VERSION); |
|
|
410
|
|
|
|
|
796
|
|
|
|
410
|
|
|
|
|
14561
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '1.370'; # NOTE - Should be #.### (three decimal places) |
|
10
|
|
|
|
|
|
|
|
|
11
|
295
|
|
|
295
|
|
113223
|
use POE::Resource::Clock qw( monotime time walltime sleep mono2wall wall2mono ); |
|
|
295
|
|
|
|
|
798
|
|
|
|
295
|
|
|
|
|
97661
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub import { |
|
14
|
380
|
|
|
380
|
|
463819
|
my $self = shift; |
|
15
|
|
|
|
|
|
|
|
|
16
|
380
|
|
|
|
|
1446
|
my @loops = grep(/^(?:XS::)?Loop::/, @_); |
|
17
|
380
|
|
|
|
|
1523
|
my @sessions = grep(/^(Session|NFA)$/, @_); |
|
18
|
374
|
|
|
|
|
3004
|
my @modules = grep(!/^(Kernel|Session|NFA|(?:XS::)?Loop::[\w:]+)$/, @_); |
|
19
|
|
|
|
|
|
|
|
|
20
|
374
|
100
|
|
|
|
1253
|
croak "can't use multiple event loops at once" |
|
21
|
|
|
|
|
|
|
if (@loops > 1); |
|
22
|
373
|
100
|
|
|
|
1021
|
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
|
355
|
100
|
|
|
|
881
|
if (@sessions) { |
|
27
|
9
|
|
|
|
|
16
|
unshift @modules, @sessions; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
else { |
|
30
|
351
|
|
|
|
|
745
|
unshift @modules, 'Session'; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
355
|
|
|
|
|
953
|
my $package = caller(); |
|
34
|
355
|
|
|
|
|
426
|
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
|
355
|
|
|
|
|
434
|
my $loop = ""; |
|
|
350
|
|
|
|
|
463
|
|
|
42
|
350
|
100
|
|
|
|
762
|
if (@loops) { |
|
43
|
3
|
|
|
|
|
5
|
$loop = "{ loop => '" . shift (@loops) . "' }"; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
350
|
|
|
|
|
622
|
my $code = "package $package; use POE::Kernel $loop;"; |
|
46
|
|
|
|
|
|
|
# warn $code; |
|
47
|
275
|
|
|
275
|
|
196337
|
eval $code; |
|
|
275
|
|
|
22
|
|
983
|
|
|
|
275
|
|
|
|
|
2221
|
|
|
|
350
|
|
|
|
|
21868
|
|
|
48
|
350
|
100
|
|
|
|
1408
|
if ($@) { |
|
49
|
1
|
|
|
|
|
13
|
warn $@; |
|
50
|
1
|
|
|
|
|
6
|
push @failed, "Kernel" |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# Load all the others. |
|
55
|
|
|
|
|
|
|
|
|
56
|
350
|
|
|
|
|
794
|
foreach my $module (@modules) { |
|
57
|
1037
|
|
|
|
|
1862
|
my $code = "package $package; use POE::$module;"; |
|
58
|
|
|
|
|
|
|
# warn $code; |
|
59
|
242
|
|
|
242
|
|
115785
|
eval($code); |
|
|
242
|
|
|
5
|
|
706
|
|
|
|
242
|
|
|
5
|
|
2174
|
|
|
|
1037
|
|
|
|
|
57061
|
|
|
60
|
1037
|
100
|
|
|
|
3859
|
if ($@) { |
|
61
|
1
|
|
|
|
|
5
|
warn $@; |
|
62
|
1
|
|
|
|
|
3
|
push(@failed, $module); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
350
|
100
|
|
|
|
1376540
|
@failed and croak "could not import qw(" . join(' ', @failed) . ")"; |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |