I have two arrays:
@arr1 = ( 1, 0, 0, 0, 1 ); @arr2 = ( 1, 1, 0, 1, 1 );
I want to sum items of both arrays to get new one like
<
If you're using Perl 6:
@a = (1 0 0 0 1) <<+>> (1 1 0 1 1) #NB: the arrays need to be the same size
The Perl 6 Advent Calendar has more examples.