in reply to General Advice
use strict; use warnings; catches one error - a missing paren.
I'd build $negative_regex in one pass:
my $negative_regex = join '|', map { s/^-//, $_ } @$negative_criteria;
And test both regexes in one pass:
foreach(@$data) { push @$results, $_ if /$match_regex/ && !/$negative_regex/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: General Advice
by Anonymous Monk on Jun 27, 2013 at 02:53 UTC | |
|
Re^2: General Advice
by yoda54 (Monk) on Jun 27, 2013 at 01:40 UTC |