my $dbh = connectDB(); my $sth = $dbh->prepare("SELECT count(id) as counted FROM perl_users WHERE `username` = ? AND `password` = ?"); $sth->execute($uname, $pass_hash); my $ref = $sth->fetchrow_hashref();