I think you wantforeach (@totalExoda){ $sum+= $clearedValue; print "$sum\n"; } #end if
However, maybe you also want to put this loop outside the first 'for-loop' because your adding values to $sum multiple times this way.foreach (@totalExoda){ $sum += $_; print "$sum\n"; } # end of for loop
In reply to Re: compound statement
by jeanluca
in thread compound statement
by props
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |