in reply to Re^2: Regex false match
in thread Regex false match
Grandfather meant \Q..\E, not \Q..\Q.
if ($line =~ m/\Q$process\E/i) {
That checks if $process is in $line. You could also use index, which might even be faster.
if (index(lc($line), lc($process)) >= 0)) {
If you wanted to check if the two vars are the same, then that should be
if ($line =~ m/^\Q$process\E\z/i) {
or
if (lc($line) eq lc($process)) {
|
|---|