Please always e-mail the beginners list, and let everyone try to help solve your
questions as I definitely don't have all the answers...
You will need to provide more information about the specifics and should probably go
through some of the beginners manuals first for this type of question. But....
Essentially you need to create a separate variable, $sum, for instance and then just
+= your odd number to that value. so:
my $sum = 0;
foreach my $odd (@odd_numbers) {
$sum += $odd;
}
would do the trick assuming your odd numbers were in an array named @odd_numbers.
http://danconia.org
------------------------------------------------
On Wed, 20 Nov 2002 09:08:19 EST, [EMAIL PROTECTED] wrote:
> hey there wiggins,
> can you help me with my beginning perl problem/
> I made a little program that counts odd numbers but i am having trouble
> adding them up as a sum.
> Any ideas?
> Thanks,
> Yvette Simon
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]