my @arr = (0,0,1, 3,2,0, 1,1,1, 11,100,12); push (@Res, eval join("+",splice(@arr,0,3))) while (@arr/3); print "@Res";