in reply to Having problems with addition in sub

Obviously other posts have covered the main points:
  1. you meant $_, not @_[$_]
  2. even if you'd wanted to index the array, the syntax is $array[$index], not @array[$index]
  3. 'use warnings' (or adding -w to your shebang line) should be your first step in troubleshooting (actually the zeroth step, you should always pre-emptively turn it on).
I'd just like to add that I think the problem also owes something to poor choice of variable names. I'm not one to say that using $_ and @_ is always evil, but compare how easy it is to spot the error:
sub total { my @numbers = @_; my $total = 0; foreach my $value (@numbers) { $total += $numbers[$value]; # Wait, what? } return $total; }