Ideally you'd want this as a plugin so it would not even do the search if it was a custom stop word.
However, a global will work and you are on the right track. How about something like:
format_error =>
my $tags = shift;
my $query = $IN->param('query');
my %stopwords = map { $_ => 1 } qw/a stop word list goes here they should be space separated/;
if (length $query < 3) {
return "Your query is to short.";
}
if (exists $stopwords{$query}) {
return "The word '$query' is a stopword.";
}
return $tags->{error}; # Display default error
}
and then do:
<%if error%>
Error: <%format_error%>
<%endif%>
Hope this helps,
Alex
--
Gossamer Threads Inc.
However, a global will work and you are on the right track. How about something like:
format_error =>
Code:
sub { my $tags = shift;
my $query = $IN->param('query');
my %stopwords = map { $_ => 1 } qw/a stop word list goes here they should be space separated/;
if (length $query < 3) {
return "Your query is to short.";
}
if (exists $stopwords{$query}) {
return "The word '$query' is a stopword.";
}
return $tags->{error}; # Display default error
}
and then do:
<%if error%>
Error: <%format_error%>
<%endif%>
Hope this helps,
Alex
--
Gossamer Threads Inc.