line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ZMQ; |
2
|
4
|
|
|
4
|
|
116826
|
use strict; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
923
|
|
3
|
|
|
|
|
|
|
our $VERSION = '1.05'; |
4
|
|
|
|
|
|
|
our $BACKEND; |
5
|
|
|
|
|
|
|
BEGIN { |
6
|
4
|
|
33
|
4
|
|
52
|
$BACKEND ||= $ENV{PERL_ZMQ_BACKEND}; |
7
|
4
|
50
|
|
|
|
13
|
if ( $BACKEND ) { |
8
|
0
|
|
|
|
|
0
|
eval "require $BACKEND"; |
9
|
0
|
0
|
|
|
|
0
|
if ($@) { |
10
|
0
|
|
|
|
|
0
|
die $@; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
} else { |
13
|
4
|
|
|
|
|
11
|
foreach my $lib ( qw(ZMQ::LibZMQ2 ZMQ::LibZMQ3) ) { |
14
|
8
|
|
|
|
|
541
|
eval "require $lib"; |
15
|
8
|
50
|
|
|
|
63
|
if ($@) { |
16
|
8
|
|
|
|
|
19
|
next; |
17
|
|
|
|
|
|
|
} |
18
|
0
|
|
|
|
|
0
|
$BACKEND = $lib; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
4
|
50
|
|
|
|
26
|
if (! $BACKEND) { |
23
|
4
|
|
|
|
|
6242
|
die "Could not find a suitable backend for ZMQ"; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
use ZMQ::Context; |
28
|
|
|
|
|
|
|
use ZMQ::Socket; |
29
|
|
|
|
|
|
|
use ZMQ::Message; |
30
|
|
|
|
|
|
|
use ZMQ::Poller; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub call { |
33
|
|
|
|
|
|
|
my $funcname = shift; |
34
|
|
|
|
|
|
|
no strict 'refs'; |
35
|
|
|
|
|
|
|
goto &{"${BACKEND}::$funcname"}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |