#!/usr/bin/perl -w use strict; my @listOfWords = qw (january february egypt moon saturday zoos zoo thingies thing ); my $text = "moon. I love full moons but this it has been a long thing since yesterday on the beach. And a whole buch of BLAH.\nYet another february line.\n More jan stuff goes here. What a zoo this text searching thing can be!"; print"\n\nUsing ListOfWord Tokens\n"; foreach my $word (@listOfWords) { if ( index($text,"$word")>= 0) { print "word: $word\t found\n"; } else { print "word: $word\t NOT found\n"; } } __END__ Using ListOfWord Tokens word: january NOT found word: february found word: egypt NOT found word: moon found word: saturday NOT found word: zoos NOT found word: zoo found word: thingies NOT found word: thing found