Hi, let's say I have:
@numbers = qw/34 56 78 83 23 99 10/;
How can I find the "sum" of all the elements in the array?
I've tried pushing a "+" (plus sign) into the array and adding it up that way, but there has to be a better way.
The total is 383, but, I don't know the routine to follow to calculate this properly. Anyone?
@numbers = qw/34 56 78 83 23 99 10/;
How can I find the "sum" of all the elements in the array?
I've tried pushing a "+" (plus sign) into the array and adding it up that way, but there has to be a better way.
The total is 383, but, I don't know the routine to follow to calculate this properly. Anyone?