Thanks for your response. I realize that a data structure such as a LoH might help, but as a relatively inexperienced perl hacker, I was hoping for something a little more concrete. Mind you, I don't need this coded for me, but a bit more direction would help.