line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::IPMessenger::EventHandler; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
59
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
341
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
2
|
|
|
2
|
1
|
5
|
my $class = shift; |
8
|
2
|
|
|
|
|
12
|
bless {}, $class; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub add_callback { |
12
|
0
|
|
|
0
|
1
|
|
my( $self, $name, $sub ) = @_; |
13
|
0
|
|
|
|
|
|
$self->{callback}->{$name} = $sub; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub callback { |
17
|
0
|
|
|
0
|
1
|
|
my( $self, $name ) = @_; |
18
|
0
|
0
|
|
|
|
|
if ( exists $self->{callback}->{$name} ) { |
19
|
0
|
|
|
|
|
|
return $self->{callback}->{$name}; |
20
|
|
|
|
|
|
|
} |
21
|
0
|
|
|
|
|
|
return; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
__END__ |