Hmm... I hate when I type something, and the website discards my message, because it thinks that I used some kind of bad language. I can think of a few situations. Also, you should maybe remove spaces from the text, because I could still play the program and get past with some bad words by inserting spaces between the letters. However, if your program uses tr to get rid of everything except letters, then the words will flow together, and you will falsely reject some letters which seem like they contain bad words but they don't. For example 'helloworld' starts with the word 'hell' so you should check if that bad word is maybe part of another word. Also, "Holy" in itself is not a bad word. But if you use it together with "Holy sh*t" then it is. Okay, so you only look for the S word. Great. But if they write "weaver's hitch" and remove everything except letters, then you got the bad word. So, it's really easy to get flagged, and it's hard to catch only the bad stuff. Like I said, I hate when some websites prevent me from posting. Facebook does this a lot. They have some sort of filter. I press "Send" and my message simply disappears. There are combination of words they dislike probably, but I haven't been able to figure it out yet.
#!/usr/bin/perl
use strict;
use warnings;
my @BADWORDS = ('hell');
$a = ' H e l l o w o r l d ! ';
$a =~ tr|a-zA-Z||cd;
$a = lc($a);
print $a;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.