in reply to Re: A better way than ||
in thread A better way than ||
Change to: for ( 0..$#weights )
Alternatively do away with all that tedious messing around with indices completely :-)
use List::Util qw( sum ); use List::MoreUtils qw( pairwise ); my $sum = sum pairwise { $a * $b } @weights, @digits;
|
|---|