#!/usr/bin/perl -w use strict; my @data = ([3], [8], [5]); my $sum += $_->[0] for @data; print "Total: $sum\n";