I didn't realise that I had 'modified' the question, so please don't read too much into that! Please read 'in' as 'of' in the line you quote. It would be irrelevant of me to show what code I had already produced because it would have no bearing on what I am trying to achieve, reading of the file and printing of the results means nothing unless you can get the code to do what you want it to. Yes I'm a novice with regards to Perl, but we all cannot know everything about everything, we all have to learn, which is what I was after, some help in what area to look at to achieve the results. Incidently I was told if I can do this exercise I'll have a good foundation to build on. You may disagree with that but then I don't do this for a living!