![]() |
|
Don't ask to ask, just ask | |
PerlMonks |
Re: Problems with looping through an arrayby hv (Prior) |
on May 27, 2004 at 11:48 UTC ( #356866=note: print w/replies, xml ) | Need Help?? |
When you encounter a new value: it s correct to initialise the count to 1, because you've just seen the first example of the new value. When you first enter the loop, though, you haven't yet seen the first example of the initial number. So you should be initialising $count to 0 before the loop, not 1. Hugo
In Section
Seekers of Perl Wisdom
|
|