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


in reply to Hash and count of data values

Instead of print "$item\t$hash{$item}\n"; try print DATA "$item\t$hash{$item}\n";. Also avoid calling your filehande DATA as this is the filehandle of the DATA section of the Perl program. And lastly, you can use my @array = <DATA>; instead of my @array = (<DATA>);.
Hope this helped.