my $test = construct_regex (@searcharray); my @results = grep { /$test/ } @longarray; sub construct_regex { my $regex = "^"; foreach my $subregex (@_){ $regex .= "(?=.*" . $subregex . ")"; } qr/$regex/; }
In reply to Re: grep for array-of-strings from an array-of-strings
by nothingmuch
in thread grep for array-of-strings from an array-of-strings
by spanner
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |