in reply to Regex: negative look ahead

This is because you did not understood the regular expressions at the fundamental level.

.*?
zero chars -> true -> after the current position is not (?!....) -> true -> return true

Use something like:
my $string = "ERROR blah license will expire"; if ($string =~ /^ERROR\b.+?(?:Error processing Cancel Execution|licens +e will expire)\b/m) { print "NOT MATCHED\n"; } else { print "MATCHED\n"; }
or:
if ($string =~ /^ERROR\b/m and $string !~ /\b(?:Error processing Cance +l Execution|license will expire)\b/) { print "MATCHED\n"; } else { print "NOT MATCHED\n"; }