in reply to Compare 2 string values
This will work for strings containing simple alphanumerics. For $str1 that might contain regex metacharacters like \,{,}, *, etc., quote the string first:$str1 = $str2 if $str2 =~ /$str1/;
-Mark$str1 = $str2 if $str2 =~ /\Q$str1\E/;
|
|---|