in reply to How can I write this in a "simpler" way?

perl -ne '$sum += $_; END { print $sum }'

--MidLifeXis