LINE: foreach my $line (@SYSLOG) { foreach my $r (@REGEXPS) { next LINE if $line =~ /$r/; } push @KEEP, $line; }