line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Dynamic; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
10816
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
156
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.01'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub UNIVERSAL::AUTOLOAD { |
7
|
1
|
|
|
1
|
|
7
|
no strict; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
447
|
|
8
|
1
|
|
|
1
|
|
162
|
my $obj = $_[0]; |
9
|
1
|
|
33
|
|
|
9
|
my $class = ref $obj || $obj; |
10
|
1
|
|
|
|
|
3
|
my @foo = @{$class."::ISA"}; |
|
1
|
|
|
|
|
4
|
|
11
|
1
|
|
|
|
|
7
|
$UNIVERSAL::AUTOLOAD =~ /(.*)::(.*)/; |
12
|
1
|
|
|
|
|
4
|
my $package = $1; |
13
|
1
|
|
|
|
|
4
|
my $method = $2; |
14
|
1
|
|
|
|
|
2
|
my $sr; |
15
|
1
|
|
|
|
|
4
|
while (@foo) { |
16
|
1
|
50
|
|
|
|
7
|
last if ($sr = shift @foo) eq "CODE"; |
17
|
|
|
|
|
|
|
} |
18
|
1
|
50
|
|
|
|
4
|
return unless ref $sr; |
19
|
1
|
|
|
|
|
4
|
my $rv = $sr->($obj, $method); |
20
|
1
|
|
|
|
|
13
|
$UNIVERSAL::AUTOLOAD =~ s/.*::/${rv}::/; |
21
|
1
|
50
|
|
|
|
6
|
if (! defined &$UNIVERSAL::AUTOLOAD) { |
22
|
0
|
|
|
|
|
0
|
require Carp; import Carp; |
|
0
|
|
|
|
|
0
|
|
23
|
0
|
0
|
|
|
|
0
|
return if $method eq "DESTROY"; |
24
|
0
|
|
|
|
|
0
|
croak( qq{Can't locate object method "$method" via package "$rv" |
25
|
|
|
|
|
|
|
(perhaps you forgot to load "$rv"?)}); |
26
|
|
|
|
|
|
|
} else { |
27
|
1
|
|
|
|
|
6
|
goto &$UNIVERSAL::AUTOLOAD; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# Preloaded methods go here. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
__END__ |