http://qs321.pair.com?node_id=230063


in reply to Perl and MySQL - performing a search...

Provided you have a good collection of bad usernames, this should do the trick:

$sth = $dbh->prepare ("SELECT count(*) FROM forbidden_usernames WHERE +f_user LIKE ?"); $sth->execute($str); ($bad) = $sth->fetchrow_array; print "Bad username\n" if $bad;

Warning: untested code! It's too late to cobble a mySQL database together to test it and my "Programming the Perl DBI" is upstairs.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law