in reply to Re: grep for array-of-strings from an array-of-strings
in thread grep for array-of-strings from an array-of-strings
Update: I realized that the 'and' case is much more difficult that the 'or' case that I presented. I would use eval for it: my $criteria = join "/ and /", @searchCriteria; $criteria = "/$criteria/"; and then use it like this grep {eval $criteria}. Which is just your second code dynamically generated.
|
|---|