in reply to A better way than ||

Is there a better way to do the above?

If i understood your question correctly the following will help you? There is a module to accomplish this job List::MoreUtils

use strict; use warnings; use List::MoreUtils qw(pairwise); @weights = (1 .. 5); @digits = (11 .. 15); @sum = pairwise { $a * $b } @weights, @digits; # returns 12, 14, 16, + 18, 20 print "@sum";

Prasad