I am using:
sub search { my $terms = shift; my $pattern = join "|", split " ", $terms; my $case = $FORM{case} eq 'insensitive'?"(?i)":""; $pattern = qr/$case$pattern/; my @matches = grep { $names[$_] =~ /$pattern/ } 0..$#names; return \@matches; }
in order to find matches in @names. I have tried every way I can think of to make the code search @names and @desc as well. I want the results of both searches stored in the same array. Then I can weed out the duplicates.
In reply to Multi @array searches by akm2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |