Harry,
when you already have all the lines in @contact_type, you have no information ready about the source of your lines. (i.e. what file did it come from)
do you care about that?
If yes I'd suggest to change the reading through the files to a similar way I did it.
If no, tell me ... Imre