Robert's Perl Tutorial

http://www.sthomas.net/roberts-perl-tutorial.htm


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/) {