You missed lecture point #0: use lexical filehandles!
In reply to Re^2: Counting multiple values in an array... by chromatic in thread Counting multiple values in an array... by dukea2006