Don't ask to ask, just ask | |
PerlMonks |
Re: Re: Re: Consolidate info in a while() loopby CountZero (Bishop) |
on Jan 21, 2003 at 22:17 UTC ( [id://228865]=note: print w/replies, xml ) | Need Help?? |
In your while-loop, obtain both the day of the week without the date (to be put into a variable $weekday) and the number (put this into $number). Once you have these data, then $total{$weekday} += $number; will add $number to the value of the hash %total keyed by $weekday. That's all there is to it. CountZero "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
In Section
Seekers of Perl Wisdom
|
|