in reply to hash and array
So very close. :-)
Change the "=1" to "++".
for my $i (@array) { $hash{$i}++; } [download]