How to find the sum of all values from two different arrays in Perl?
@array1 = (1, 2, 3);
@array2 = (10, 10, 10);
@sumofarray1and2 = ?
So I figured I can do two kinds of things here. I can do two foreach
loops and add contents of @array1
and @array2
first then get the sum of both.