Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: compare two values in perl
by friedo (Prior) on Dec 09, 2006 at 21:23 UTC | |
by Devanchya (Beadle) on Dec 10, 2006 at 04:40 UTC | |
|
Re: compare two values in perl
by madbombX (Hermit) on Dec 09, 2006 at 21:26 UTC | |
by Anonymous Monk on Dec 10, 2006 at 01:28 UTC |