note
akm2
<p>I've ask about about this before, I know (sorry but I need to do it again).
I don't understand how to rewrite the code to store only the index number of the matching <code>@names</code> elements in </code>@matches</code>.</p>
<P>below is the current code.</P>
<P><code>sub search {
my $terms = shift;
my $pattern = join "|", split " ", $terms;
my $case = $FORM{case} eq 'insensitive'?"(?i)":"";
$pattern = qr/$case$pattern/;
my @matches = grep { /$pattern/ } @names;
return \@matches;
}</code></P>
<P>Can somebody educate me, please.</p>
65733
65798