in reply to How can I count and display unique items in an array? (was: array counting)
Provided it's not to memory intensive you can stick everything into a hash and iterate through the hash:
foreach $item (@yourList) { $newHash{$item}++; } print "<TABLE>\n"; foreach $item (keys %newHash) { print "<TR><TD>$item</TD><TD>$newHash{$item}</TD></TR>\n"; } print "</TABLE>\n";
This is, of course, a very simple answer and I'm sure there are more efficient ways to do it, but there you are.
EDIT: Whoops, didn't realize this fella posted the same question 3 times (naughty). The original question is already answered quite sufficiently here by mephit in a much more compact way than my solution.
|\/|eraxes
|
|---|