@username = grep /^$usernameentered$/, @row;
Will give you a list of all the columns containing only $usernameentered (note the ^ and $).
unless (@username) {
print "incorrect username entered @username\n";
}
| [reply] [d/l] [select] |
Perhaps the best solution would be to replace the wildcard in the query with a named list, starting with username and password. Then, you could avoid grep altogether and just match the array elements directly. Or, you could keep the wildcard and fetchrow_hashref, and use the column names to find the info you need. | [reply] |