line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Object::Sub; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
14681
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
85
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.102'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTOLOAD; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use overload fallback => 1, |
10
|
|
|
|
|
|
|
'&{}' => sub { |
11
|
3
|
|
|
3
|
|
12
|
my $self_ref = \$_[0]; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
return sub { |
14
|
3
|
|
|
3
|
|
8
|
return $$self_ref->{cb}->($$self_ref, undef, @_); |
15
|
3
|
|
|
|
|
7
|
}; |
16
|
1
|
|
|
1
|
|
1079
|
}; |
|
1
|
|
|
|
|
853
|
|
|
1
|
|
|
|
|
8
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub AUTOLOAD { |
19
|
3
|
50
|
|
3
|
|
949
|
die "$_[0] is not an object" if !ref $_[0]; |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
4
|
my $name = $AUTOLOAD; |
22
|
3
|
|
|
|
|
13
|
$name =~ s/.*://; |
23
|
|
|
|
|
|
|
|
24
|
3
|
|
|
|
|
32
|
return $_[0]->{cb}->($_[0], $name, @_[1 .. $#_]); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new { |
28
|
5
|
|
|
5
|
0
|
4698
|
my ($class, $cb) = @_; |
29
|
|
|
|
|
|
|
|
30
|
5
|
50
|
|
|
|
14
|
die "need a callback" if ref $cb ne 'CODE'; |
31
|
|
|
|
|
|
|
|
32
|
5
|
|
|
|
|
10
|
my $self = { cb => $cb, }; |
33
|
5
|
|
|
|
|
6
|
bless $self, $class; |
34
|
|
|
|
|
|
|
|
35
|
5
|
|
|
|
|
7
|
return $self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
## Prevent DESTROY method from being handled by AUTOLOAD |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
0
|
|
|
sub DESTROY { |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |