in reply to Comparing strings
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]) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Comparing strings
by ikegami (Patriarch) on Jul 24, 2006 at 15:06 UTC |