in reply to don't get bit by split.
in thread @arrys & Non exact searches.
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 @names elements in </code>@matches</code>.
below is the current 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; }
Can somebody educate me, please.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: don't get bit by split.
by runrig (Abbot) on Mar 21, 2001 at 21:43 UTC | |
Re: Re: don't get bit by split.
by davorg (Chancellor) on Mar 21, 2001 at 21:51 UTC |
In Section
Seekers of Perl Wisdom