in reply to Add a list of numbers together

the recursion is interesting, but i would probably do it like so: sub add { my $sum; $sum += $_ for @_; $sum } update: separated declaration of $sum from for loop after reading ZZamboni's observations.