2 # Search for bad words in strings
4 # Copyright (c) 2000 Dirk Koopman
17 use vars qw(%badwords $fn);
19 $fn = "$main::data/badwords";
22 use vars qw($VERSION $BRANCH);
23 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
24 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0;
25 $main::build += $VERSION;
26 $main::branch += $BRANCH;
28 # load the badwords file
33 my $fh = new IO::File $fn;
47 my $l = "can't open $fn $!";
54 # check the text against the badwords list
57 return grep { $badwords{$_} } split(/\b/, lc shift);