in reply to Alternative matches
I've used Regexp::Optimizer in the past for long lists to do the character class thing like above, and it works fine. Unless you're using _very_ long lists to match, in which case constructing the regexp can take a long time (with some deep recursion thrown in).
One other thing to note is that for the simple complete word case you give, it's probably a good idea to anchor the words with \b($string_of_words)\b or ^($string_of_words)$.