Just another Perl shrine | |
PerlMonks |
Re: Adding and Multplying Elements in an Arrayby monsieur_champs (Curate) |
on Jun 18, 2003 at 14:58 UTC ( [id://266853]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|