akm2 has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multi @array searches
by OeufMayo (Curate) on Mar 22, 2001 at 18:33 UTC | |
|
Re: Multi @array searches
by arturo (Vicar) on Mar 22, 2001 at 18:50 UTC | |
by akm2 (Scribe) on Mar 24, 2001 at 03:12 UTC | |
by arturo (Vicar) on Mar 24, 2001 at 03:25 UTC | |
|
Re: Multi @array searches
by jorg (Friar) on Mar 22, 2001 at 22:13 UTC | |
by tye (Sage) on Mar 22, 2001 at 22:22 UTC | |
by jorg (Friar) on Mar 22, 2001 at 22:49 UTC |