my $emsg= '';
my @results;
my @specs;
+my $canontext;
my $hooks = { Emsg => \$emsg, String => \$string,
Results => \@results, Specs => \@specs,
+ Canon => \$canontext
};
if ($chk->method_exists('preparse')) {
my $err= sub { $emsg= $_[0]; last; };
my %m;
my $results;
- foreach my $pat ("$each", "$each\%", "\%$each\%") {
+ my @pats= ("$each", "$each\%", "\%$each\%");
+ if ($chk->attr_exists('abbrev_initials')) {
+ push @pats, join ' ', map { "$_%" } split //, $each;
+ }
+ foreach my $pat (@pats) {
$sth->execute(($pat) x @sqlstmt_qs);
$results= $sth->fetchall_arrayref();
last if @$results==1;
push @results, $results->[0];
};
-my $canontext= join ' | ', map { $_->[0] } @results;
+if (!defined $canontext) {
+ $canontext= join ' | ', map { $_->[0] } @results;
+}
if ($chk->method_exists('postquery')) {
- $hooks->{Canon}= \$canontext;
$chk->call_method('postquery', h => $hooks);
}