The appropriate data structure to use here would be a hash of hashes - I would probably create a new variable which used date as the first key and KBID as the second. Information on HoH can be found in perldsc, as well as in perlref and perllol.
Comment on Re^3: Counting matching Lines of an Array