my $sth = $dbh->prepare("SELECT uid FROM user_accounts WHERE username ~~* ?"); $sth->execute($username); my ($uid) = $sth->fetchrow_array;