2 # Search for bad words in strings
4 # Copyright (c) 2000 Dirk Koopman
18 use vars qw($badword);
20 my $oldfn = "$main::data/badwords";
21 $badword = new DXHash "badword";
23 use vars qw($VERSION $BRANCH);
24 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
25 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0;
26 $main::build += $VERSION;
27 $main::branch += $BRANCH;
29 # load the badwords file
33 return unless -e $oldfn;
34 my $fh = new IO::File $oldfn;
49 my $l = "can't open $oldfn $!";
56 # check the text against the badwords list
59 return grep { $badword->in($_) } split(/\b/, lc shift);