in reply to Re: Username regex, MYSQL random
in thread Username regex, MYSQL random

That's the best way to do it, though it is platform dependent.
my $row = $dbh->selectrow_arrayref(" SELECT ... FROM ... WHERE ... ORDER BY RANDOM LIMIT 1");
That should return a single row as an array reference, chosen at random from all possible rows that meet your WHERE criteria.