@product; $i = 0; if ($#Arr1 == $#Arr2) { foreach(@Arr1) { $product = $_ * $Arr2[$i]; ++$i; } } else { print "Do you really want to multiply unequal length of arrays?\n"; }
Originally posted as a Categorized Answer.
In reply to Re: Can I multiply corresponding numbers in two arrays together?
by rajib
in thread How do I multiply the corresponding elements in two arrays together?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |