Negating the regex
If you want to negate the entire regex change =~ to
!~ (Remember ! means
'not equal to'.)
if ($_ !~/[KC]arl/) {
Of course, as we are testing $_
this works too:
if (!/[KC]arl/) {
Table of Contents
If you want to negate the entire regex change =~ to
!~ (Remember ! means
'not equal to'.)
if ($_ !~/[KC]arl/) {
Of course, as we are testing $_
this works too:
if (!/[KC]arl/) {