@numbers = (2,3,4,5); $total = 1; for(@numbers){ $total = ($total * $_); } print $total;
Is there a smarter way? It kind of bugged me that I need to use that variable and do one meaningless multiplication.
($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print
In reply to Multiplying together the numers in an array by Cody Pendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |