sub total { my @numbers = @_; my $total = 0; foreach my $value (@numbers) { $total += $numbers[$value]; # Wait, what? } return $total; }