@a= <>; foreach (@a) { $total += $_; ++$count; } print "total of $count items is $total\n";