Hey Roy Johnson,
Thank you for your reply. I tried it and it works. Could you explain the logic to me though, please? My understanding of it is you're creating a new variable which you call $flip and saying what this flip is equal to, i.e it's equal to both word equal to previous word and word that isn't equal to previous word, and then if this flip is equal to 1, i.e the word that is the immediate next one along in an input of text. Is my understanding correct? I would really appreciate your help. Thank you,