First, You haven't duplicated Abigail-II's expression correctly; if you do so, it will work correctly:
if ($line =~ /^(?:(?!throw).)*$/s) { debug ("Doesn't contain throw"); }
An alternative formulation, which I find slightly cleaner, is to recast it as a single negative lookahead:
if ($line =~ /^(?!.*?throw)/) { ... }
Hugo
In reply to Re^2: Can't match negated words.
by hv
in thread Can't match negated words.
by perlgags78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |