in reply to Compare 2 string values

To see if $str1 is in $str2, you could use the matching operator:
$str1 = $str2 if $str2 =~ /$str1/;
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 =~ /\Q$str1\E/;

-Mark