line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Dataset::Classic; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
96451
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
5
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
882
|
use Storable; |
|
1
|
|
|
|
|
3538
|
|
|
1
|
|
|
|
|
69
|
|
8
|
1
|
|
|
1
|
|
785
|
use Module::Load; |
|
1
|
|
|
|
|
1170
|
|
|
1
|
|
|
|
|
7
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.001'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# ABSTRACT: Classic datasets for examples, testing and illustrative purposes |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _adapt { |
15
|
0
|
|
|
0
|
|
|
my $dataset = shift(); |
16
|
0
|
|
|
|
|
|
my $data = Storable::dclone($dataset); |
17
|
0
|
|
|
|
|
|
my %params = @_; |
18
|
0
|
|
|
|
|
|
my $as = $params{'as'}; |
19
|
0
|
0
|
|
|
|
|
if ( defined $as ) { |
20
|
0
|
|
|
|
|
|
my $adapter_name = 'Data::Dataset::Classic::Adapter::' . $as; |
21
|
0
|
|
|
|
|
|
eval { |
22
|
0
|
|
|
|
|
|
Module::Load::load $adapter_name; |
23
|
0
|
|
|
|
|
|
my $adapter = $adapter_name->new(); |
24
|
0
|
|
|
|
|
|
$data = $adapter->from($data); |
25
|
|
|
|
|
|
|
}; |
26
|
0
|
0
|
|
|
|
|
if ($@) { |
27
|
0
|
|
|
|
|
|
warn 'Cannot load adapter: ' . $adapter_name . '. Returning data as a hashref. ' . $@; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
return $data; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |