Thanks for the articles which I've skimmed over to read fully later. What I'm trying to do is to create a concordance which allows the user to search a text and then find all the occurences of a word and some sample text to work out if that's the section they are looking for and where it is in the text.
Its part of a personal project to try and create some useful textual analytical tools. Also it seemed like a good way to extend my nascent knowledge of Perl into something practical whilst learning. I'll need to think about those two words.