in reply to How can I populate a hash?

Counting is probably the best way, even though it isn't exciting. Of course there are other ways. One that comes to mind is:
my %h; @h{@a} = (); # make a set of the unique strings for my $k ( keys %h ) { $h{$k} = () = grep { $_ eq $k } @a; # get count of matching elements }
But somehow I doubt that's more efficient. ;-)