in reply to Re: Pattern problem
in thread Pattern problem

$text =~ /Host System (?!#)/ is correct too. However, [^#] is probably faster and an acceptable replacement in this case.

The problem is
if $text =~ /Host System (?!#)/ next;
was used instead of
if ($text =~ /Host System (?!#)/) { next; }
or
next if ($text =~ /Host System (?!#)/);
or
next if $text =~ /Host System (?!#)/;