#!usr/bin/perl use strict; use warnings; use Data::Dumper; use List::Util qw/sum/; my $rows = [ [1, 2, 3], [1, 2, 3], [1, 2, 3], ]; my @row_sum = map { sum @$_ } @$rows; print Dumper \@row_sum; my $total_sum = sum @row_sum; print $total_sum . "\n";