in reply to Summing repeated counts for items stored in separate file
"...many millions of lines ... (big) files..."
It may be worth considering a disk based hash like DBM::Deep.