Sigh. This is hardly homework- given that I'm self taught and finished taking classes several years ago. Being a perl-newb I wrote the above code in around 10 minutes. It works fine for me just as it is, and the question is posted about as simply as can be. If you run the code or even briefly examine it you'll see what I'm looking for.