You want to make sure that the whole string matches and not just a substring. You can use the "anchors" ^ (start of string) and $ (end of string) for that:
if($a[$i] =~ /^$b[$j]$/i)
But if you want to compare the whole string, a direct comparison of the upper case variants is more straightforward:
if(uc $a[$i] eq uc $b[$j]) { ... }
In reply to Re: Comparing strings
by Corion
in thread Comparing strings
by tanyeun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |