http://qs1969.pair.com?node_id=284568


in reply to Hash and count of data values

print "$item\t$hash{$item}\n";

should probably be something like

foreach (keys %hash) { print "$_\t$hash{$_}\n"; }

Note that you also have two sets of open and close calls in your snippet. Maybe you should look at one open/close with a while(<DATA>) {...} loop that populates your hash.
--
bm