sub spell::spell {
my $query = shift;
+ if ($query =~ m/[^[:alpha:]]/) {
+ return('only one word of alphabetic characters supported');
+ }
+
my $binary;
my @binaries = (
'/usr/bin/aspell',
}
if (!$binary) {
- return("no binary found.");
+ return('no binary found.');
}
- if (!&main::validExec($query)) {
- return("argument appears to be fuzzy.");
+ if (!&::validExec($query)) {
+ return('argument appears to be fuzzy.');
}
my $reply = "I can't find alternate spellings for '$query'";
$reply = "possible spellings for $query: @array";
last;
} elsif (/^\+/) {
- &main::DEBUG("spell: '+' found => '$_'.");
+ &::DEBUG("spell: '+' found => '$_'.");
last;
} elsif (/^# (.*?) 0$/) {
# none found.
last;
} else {
- &main::DEBUG("spell: unknown: '$_'.");
+ &::DEBUG("spell: unknown: '$_'.");
}
}