in reply to Finding best matches

IMHO, the best approach would be to normalize the database. Unless every record has six keywords, no more, no less, ever, the keywords should be in their own table linked by some record id.

That said, I'm not seeing the Perl question here...