#!/usr/bin/perl -w use strict; my @amounts = qw(-161.05 177.28 -16.23); my $sum = 0.0; map {$sum += $_} @amounts; print "sum = $sum\n";