dmaranan has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to figure out the most elegant way on how to provide summary statistics on the items on that array with perl. The output would be some kind of associative array:@status = ("Applied", "Enrolled", "Admitted", "Applied", "Enrolled");
I know that I can do this by doing another database call using COUNT, but I want to minimize the number of database queries that I do. Thoughts anyone?@statuscount = ("Admitted" => "1", "Applied" => "2", "Enrolled" => "2" +);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Counting elements in array and outputing the count and item
by toolic (Bishop) on Jun 17, 2008 at 18:25 UTC | |
|
Re: Counting elements in array and outputing the count and item
by Corion (Patriarch) on Jun 17, 2008 at 18:28 UTC | |
|
Re: Counting elements in array and outputing the count and item
by monarch (Priest) on Jun 17, 2008 at 18:28 UTC | |
by dmaranan (Acolyte) on Jun 17, 2008 at 18:44 UTC | |
by wfsp (Abbot) on Jun 18, 2008 at 06:26 UTC | |
|
Re: Counting elements in array and outputing the count and item
by psini (Deacon) on Jun 17, 2008 at 18:26 UTC | |
|
Re: Counting elements in array and outputing the count and item
by psini (Deacon) on Jun 17, 2008 at 18:30 UTC |