Thanks to all...Appreciate your help. -----Original Message----- From: Hearn, Stan (CEI-Atlanta) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 29, 2003 1:16 PM To: Krishna, Hari; [EMAIL PROTECTED] Subject: RE: string compare
-----Original Message----- From: Krishna, Hari [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 29, 2003 12:57 PM To: [EMAIL PROTECTED] Subject: string compare Friends, I have two string $m1="hari$"; $t1="HaRi$"; How do I compare irrespective of the case? Since they are strings, I have to use 'eq' as comparison operator. if ($m1 eq $t1) -- doesn't work as it looks at the case $m1 eq m/$t1/i ---- I know m// is used to match a string against a regular expression. $m1 eq ~/$t1/ ............. Thanks for any help. Hari.. ------------------- Save on processing speed. Force them both to upper case to compare: if (uc($m1) eq uc($t1)) { print "They match\n"; } else { print "They don't match\n"; } Stan CONFIDENTIALITY NOTICE: This e-mail message, including all attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. You may NOT use, disclose, copy or disseminate this information. If you are not the intended recipient, please contact the sender by reply e-mail immediately. Please destroy all copies of the original message and all attachments. Your cooperation is greatly appreciated. Columbus Regional Hospital 2400 East 17th Street Columbus, Indiana 47201 _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs