line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Encoder; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
406
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
52
|
|
4
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
49
|
|
5
|
2
|
|
|
2
|
|
37
|
use 5.008_001; |
|
2
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.04_01'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub load { |
9
|
1
|
|
|
1
|
1
|
12
|
my ($class, $klass, $args) = @_; |
10
|
1
|
|
|
|
|
4
|
$klass = _load_class($klass, __PACKAGE__); |
11
|
1
|
|
|
|
|
10
|
return $klass->new($args); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# code taken from Tiffany |
15
|
|
|
|
|
|
|
my %loaded; |
16
|
|
|
|
|
|
|
sub _load_class { |
17
|
1
|
|
|
1
|
|
2
|
my ( $class, $prefix ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
1
|
50
|
|
|
|
5
|
if ($prefix) { |
20
|
1
|
50
|
33
|
|
|
23
|
unless ( $class =~ s/^\+// || $class =~ /^$prefix/ ) { |
21
|
1
|
|
|
|
|
5
|
$class = "$prefix\::$class"; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
1
|
50
|
|
|
|
5
|
return $class if $loaded{$class}++; |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
2
|
my $file = $class; |
28
|
1
|
|
|
|
|
6
|
$file =~ s!::!/!g; |
29
|
1
|
|
|
|
|
488
|
require "$file.pm"; ## no critic |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
5
|
return $class; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
__END__ |