Hello, little fellow.
Homework, hum? So I think you shall live by the Perl Motto "There Is More Than One Way To Do It tm". I use map to do it: map $sum+=$_, @even; and map $mul*=$_, ($sum=1),@odd;
I'm posting this as a motivation for you try to figure "Yet Another Way To Do It tm". Please consider my proposal serioulsly.
May the gods bless you.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Just Another Perl Monk
In reply to Re: Adding and Multplying Elements in an Array
by monsieur_champs
in thread Adding and Multplying Elements in an Array
by Dru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |