in reply to I need speed

a DBM hash wouldn't do you any good, because you need to process the entire file anyway. the benefit of a DBM is that it speeds up accessing specific elements of the file. you are sequentially reading the whole thing.