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 4487 May 7, 2020, 5:58 PM
Thread Re: [delicia] string matching problem
Andy 4409 May 7, 2020, 11:36 PM
Thread Re: [Andy] string matching problem
delicia 4402 May 8, 2020, 5:54 AM
Thread Re: [delicia] string matching problem
Andy 4395 May 8, 2020, 6:17 AM
Thread Re: [Andy] string matching problem
delicia 4406 May 8, 2020, 6:36 AM
Post Re: [delicia] string matching problem
Andy 4381 May 8, 2020, 6:39 AM