$tempmsg =~ s/\s*#.+$//; # comments my @check = grep { length($_) < 80 } # no super-long votes map { s/^\s*//; s/\s*$//; s/\s+/ /; $_ } # space normalization split /[;,()]+/, $tempmsg; # the dividers for my $tempmsg2 ( @check ) { # (allowed chars..................) (strip (and the vote) # extras) if ( $tempmsg2 =~ /^([a-zA-Z0-9-_{}^\[\]\|=\s\+\*\#\.]+?)[\s\+\-]*(\+\+|--)$/ ) { my ( $word, $plusorminus ) = ( lc($1), $2 ); next if $word =~ /\.\s/; # try to avoid sentence punctuation, but leave domain names next if $seen{$word}; $seen{$word} = 1;