cjeopardy filter: Make comma substitution global

This commit is contained in:
Pragmatic Software 2017-02-21 05:50:02 -08:00
parent 1e4e101386
commit e4ca260aaf
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ use strict;
use Fcntl qw(:flock);
my $MAX_WORDS = 3;
my $MAX_WORDS = 15;
my $CJEOPARDY_DATA = 'data/cjeopardy.dat';
my $CJEOPARDY_FILTER = 'data/cjeopardy.filter';
@ -28,7 +28,7 @@ if (not length $filter) {
my $words = <$fh>;
close $fh;
chomp $words;
$words =~ s/,/, /;
$words =~ s/,/, /g;
$words =~ s/, ([^,]+)$/ or $1/;
print "Filter active. Questions containing $words will be skipped. Usage: filter <comma or space separated list of words> or `filter clear` to clear.\n";
exit;