Gossamer Forum
Home : General : Perl Programming :

string matching problem

Quote Reply
string matching problem
i have this code
Code:
$found = 'nope'; $user = 'delicia';

my (%rec2) = &array_to_hash2($_, @hits2);
if ($user eq $rec2{'Userid'}) { $found eq 'found her'; }
print qq|<p>-$rec2{'Userid'}- $found -$user-|;

which is producing the following result:
-delicia- nope -delicia-
i put the dashes around the variables to see if there were any weird characters or spaces. why doesn't the code see that the two strings are identical???


Subject Author Views Date
Thread string matching problem delicia 303 May 7, 2020, 5:58 PM
Thread Re: [delicia] string matching problem
Andy 299 May 7, 2020, 11:36 PM
Thread Re: [Andy] string matching problem
delicia 295 May 8, 2020, 5:54 AM
Thread Re: [delicia] string matching problem
Andy 292 May 8, 2020, 6:17 AM
Thread Re: [Andy] string matching problem
delicia 289 May 8, 2020, 6:36 AM
Post Re: [delicia] string matching problem
Andy 287 May 8, 2020, 6:39 AM