line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tree::Compat; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
115878
|
use strict; |
|
9
|
|
|
|
|
24
|
|
|
9
|
|
|
|
|
345
|
|
4
|
9
|
|
|
9
|
|
47
|
use warnings; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
258
|
|
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
9
|
|
10534
|
use UNIVERSAL::require; |
|
9
|
|
|
|
|
16807
|
|
|
9
|
|
|
|
|
96
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
9
|
|
|
9
|
|
77
|
my $self = shift; |
12
|
9
|
|
|
|
|
34
|
foreach my $module ( @_ ) { |
13
|
8
|
|
|
|
|
29
|
$self->load( $module ); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my %mapping = ( |
18
|
|
|
|
|
|
|
'Tree::Simple' => 'Tree::Compat::Tree::Simple', |
19
|
|
|
|
|
|
|
'Tree::DAG_Node' => 'Tree::Compat::Tree::DAG_Node', |
20
|
|
|
|
|
|
|
'Tree::Nary' => 'Tree::Compat::Tree::Nary', |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub load { |
24
|
8
|
|
|
8
|
1
|
13
|
my $self = shift; |
25
|
8
|
|
|
|
|
16
|
my $class = shift; |
26
|
|
|
|
|
|
|
|
27
|
8
|
50
|
|
|
|
42
|
unless ( exists $mapping{ $class } ) { |
28
|
0
|
|
|
|
|
0
|
die "'$class' doesn't have a compatibility layer written yet.\n"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
8
|
100
|
|
|
|
45
|
$mapping{ $class }->require or die $UNIVERSAL::require::ERROR; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
__END__ |