|laziness, impatience, and hubris|
Sure, that'll work... you can get your long list of bad words from anywhere: a database table, an external file, a __DATA__ section, whatever.
A couple of small comments: you should avoid using "*" when you SELECT in your code. If you really want all the columns it's much better to select them by name. Not only do you conserve memory and bandwidth by selecting only what you need, but your code is better documented and you get to avoid future problems if you ever decide you want to fetchrow() instead of fetchrow_hashref().
Secondly, I'd re-arrange your code a little:
The $sth->finish isn't really necessary unless you have a LOT of data in your result set...but that's just a matter of style. TMWOWTDI.
In reply to Re: Re: Re: Re: Perl and MySQL - performing a search...