In the above i am trying to pass a value from the 'user' table into the variable $usr, and then compare it to the value in $user_name. The problem is that the value in $usr is not a string as expected, when i print it to the screen it appears as DBI::st=HASH(0x83d7068) Can anybody tell me why this happens? And if there is anyway to compare these two values. Thanksmy $usr; $usr = $dbh->prepare(q{SELECT user_id from user where user_id = ?}); $usr->execute($user_name); if($user_name eq $usr) { #Do something here }
In reply to compare two values in perl by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |