By default, two-letter words are the shortest allowed. Are you wanting to allow searching on ONLY two-letter words?
In
search.cgi, change the
< (
less-than) to
!= (not-equals) to allow ONLY two-letter search terms. You should probably also work on an error message, and/or change the search box to a two-character field (size="2"). Code:
sub search {
# --------------------------------------------------------
# This routine does the actual search of the database.
#
my ($search_terms, $bool) = @_;
my ($regexp, @values, $grand_total, $match, $andmatch, $field, $or_match, %seen, $link, $tmp);
# Save the reg expressions to avoid rebuilding.
$or_match = $bool ne 'and';
if ($or_match) {
for (0 .. $#{$search_terms}) {
next if (length ${$search_terms}[$_]
< 2); # Skip single letter words.
$tmp .= "m/\Q${$search_terms}[$_]\E/io ||";
}
}
else {
for (0 .. $#{$search_terms}) {
next if (length ${$search_terms}[$_]
< 2); # Skip single letter words.
$tmp .= "m/\Q${$search_terms}[$_]\E/io &&";
}
}
Leonard
aka PerlFlunkie