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