+ } elsif ($type =~ /^listfix$/i) {
+ # Custom select statement.
+ my $query = "SELECT factoid_key,factoid_value FROM factoids";
+ my $sth = $dbh->prepare($query);
+ &ERROR("factstats(listfix): => '$query'.") unless $sth->execute;
+
+ my @list;
+ while (my @row = $sth->fetchrow_array) {
+ my($key,$val) = ($row[0], $row[1]);
+ my $match = 0;
+ $match++ if ($val =~ /\S+,? or \S+,? or \S+,? or \S+,?/);
+ next unless ($match);
+
+ $key =~ s/\,/\037\,\037/g;
+ push(@list, $key);
+ $val =~ s/,? or /, /g;
+ &DEBUG("fixed: => $val.");
+ &setFactInfo($key,"factoid_value", $val);
+ }
+ $sth->finish;
+
+ # parse the results.
+ my $prefix = "Inefficient lists fixed ";
+ return &formListReply(1, $prefix, @list);
+