If you want case sensitive matching, just remove the i at the end.
In any case your test will return true if $test1 is a substring of $test, and if it contains special regex syntax it's something else completely. So you could do
instead to avoid that.if ($test =~ m/^\Q$test1\E\z/) { ... }
In reply to Re: How to match String with Case Sensitive??
by moritz
in thread How to match String with Case Sensitive??
by Sachin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |