if ($line =~ /^(?:(?!throw).)*$/s) { debug ("Doesn't contain throw"); } #### if ($line =~ /^(?!.*?throw)/) { ... }