use warnings; use strict; use List::Util qw(sum); my @fred = qw{ 1 3 5 7 9 }; my $fred_total = sum(@fred); print "The total of \@fred is $fred_total.\n"; #### The total of @fred is 25.