# from your add_words() sub ... $words{"$category-$word"} += $words_in_file{$word};