line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::SumOf; |
2
|
2
|
|
|
2
|
|
88653
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
81
|
|
3
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
64
|
|
4
|
2
|
|
|
2
|
|
10
|
use base qw(Template::Plugin); |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
1874
|
|
5
|
2
|
|
|
2
|
|
6526
|
use Carp; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
156
|
|
6
|
2
|
|
|
2
|
|
1163
|
use Template::Stash; |
|
2
|
|
|
|
|
20756
|
|
|
2
|
|
|
|
|
54
|
|
7
|
2
|
|
|
2
|
|
16
|
use List::Util qw/sum/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
227
|
|
8
|
2
|
|
|
2
|
|
12
|
use Scalar::Util qw/blessed/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
76
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
1827
|
use version; |
|
2
|
|
|
|
|
3925
|
|
|
2
|
|
|
|
|
11
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$Template::Stash::LIST_OPS->{sum_of} = sub { |
14
|
|
|
|
|
|
|
my ( $self, $column ) = @_; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
return sum map { blessed $_ ? $_->$column : $_->{$column} } @$self; |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
20
|
|
|
|
|
|
|
__END__ |