line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (C) 2003-2007, G. Allen Morris III, all rights reserved |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
50
|
|
4
|
|
|
|
|
|
|
package |
5
|
|
|
|
|
|
|
Data::Tabular::Row::Averages; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
4
|
use base 'Data::Tabular::Row::Function'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
88
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
6
|
use Carp qw(croak carp); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
275
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub get_column |
12
|
|
|
|
|
|
|
{ |
13
|
7
|
|
|
7
|
0
|
14
|
my $self = shift; |
14
|
7
|
|
|
|
|
20
|
my $column_name = shift; |
15
|
7
|
|
|
|
|
10
|
my $ret; |
16
|
7
|
|
|
|
|
116
|
my $reg = qr|^$column_name$|; |
17
|
|
|
|
|
|
|
|
18
|
7
|
100
|
|
|
|
23
|
if ($column_name eq '_description') { |
|
6
|
100
|
|
|
|
22
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
19
|
1
|
|
|
|
|
12
|
$ret = Data::Tabular::Type::Number->new( |
20
|
|
|
|
|
|
|
data => $self->{text}, |
21
|
|
|
|
|
|
|
type => 'description', |
22
|
|
|
|
|
|
|
); |
23
|
1
|
50
|
|
|
|
17
|
} elsif (grep(m|$reg|, @{$self->sum_list})) { |
24
|
5
|
|
|
|
|
17
|
$ret = $self->table->column_average($column_name); |
25
|
|
|
|
|
|
|
} elsif (grep(m|$reg|, @{$self->{extra}->{headers} || []})) { |
26
|
0
|
|
|
|
|
0
|
die 'extra'; |
27
|
0
|
|
|
|
|
0
|
$ret = "extra($column_name)"; |
28
|
|
|
|
|
|
|
} elsif ($column_name eq '_filler') { |
29
|
1
|
|
|
|
|
7
|
$ret = Data::Tabular::Type::Number->new( |
30
|
|
|
|
|
|
|
data => '', |
31
|
|
|
|
|
|
|
type => 'filler', |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
} else { |
34
|
0
|
|
|
|
|
0
|
$ret = 'N/A('. $column_name . ')'; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
7
|
|
|
|
|
29
|
return $ret; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
__END__ |