in reply to Sum of values in an array
use warnings; use strict; use List::Util qw(sum); my @pe_total = ( { 'COMP_TOTAL' => '2445.00' }, { 'COMP_TOTAL' => '728.00' } ); print sum(map { $_->{COMP_TOTAL} } @pe_total), "\n"; __END__ 3173
See also:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sum of values in an array
by Anonymous Monk on Sep 25, 2014 at 19:51 UTC | |
by Anonymous Monk on Sep 25, 2014 at 19:57 UTC | |
by toolic (Bishop) on Sep 25, 2014 at 19:58 UTC |