+ if (scalar(@NoWildcardGroups)) {
+ # add 'OR' if SQL clause is not empty
+ $SQL .= ' OR ' if $SQL;
+ if (scalar(@NoWildcardGroups) < 2) {
+ # special case: just one newsgroup without wildcard
+ $SQL .= 'newsgroup = ?';
+ } else {
+ # create list of newsgroups to include: 'newsgroup IN (...)'
+ $SQL .= 'newsgroup IN (';
+ my $SQLin;
+ foreach (@NoWildcardGroups) {
+ $SQLin .= ',' if $SQLin;
+ $SQLin .= '?';
+ }
+ # add list to SQL clause
+ $SQL .= $SQLin .= ')';
+ }
+ }
+ # add brackets '()' to SQL clause as needed (more than one wildcard group)
+ if (scalar(@WildcardGroups)) {
+ $SQL = '(' . $SQL .')';
+ }
+ # rebuild @GroupList in (now) correct order
+ @GroupList = (@WildcardGroups,@NoWildcardGroups);