Use "eq" (as well as lt, gt, ne, ge, le, cmp) for string matching.  The
operators "==" (as well as <, >, !=, >=, <=, <=>) for numeric matching.
Perl will convert the values based on the operator used.

So with "==", like you are using, Perl converts both arguments to numbers
before comparing.

So this is what you want...

$mystr eq "exactstr"

Rob

-----Original Message-----
From: rkl [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 02, 2003 2:12 PM
To: perl
Subject: exact string match?


How to test for exact string match? 

this doesn't work: 

$mystr == "exactstr" 

thanks
 -rkl

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to