in reply to Fast/efficient way of check if a string in an strArr is contained in a line

You could get out of the "foreach" loop as soon as a match occurs, either using last or return:
sub check_bypass { my $line = shift; foreach (@_) { if ($line =~ /$_/i) {return 0} } return 1; }
  • Comment on Re: Fast/efficient way of check if a string in an strArr is contained in a line
  • Download Code