in reply to How can I count and display unique items in an array? (was: array counting)

This oughta work...
use strict; my @array = qw(foo bar foobar foobar bar bar bar bar foo foo foo foo b +ar foobar); my %hash; $hash{$_}++ foreach @array; print "Content-type: text/plain\n\n"; foreach (keys %hash) { print "$_ appears $hash{$_} times\n"; }
The above will return...
foobar appears 3 times foo appears 5 times bar appears 6 times

Joshua