Think about Loose Coupling | |
PerlMonks |
prohibiting certain stringsby keiusui (Monk) |
on Dec 28, 2005 at 23:15 UTC ( [id://519664]=perlquestion: print w/replies, xml ) | Need Help?? |
keiusui has asked for the wisdom of the Perl Monks concerning the following question:
I want a Perl program to quit when a user enters the word, "badword". Therefore I have the following conditional:
This works for most users, but some clever users have bypassed the conditional by submitting strings such as "bad.word", "b.a.d.w.o.r.d", "b/a/d/w/o/r/d" and "b a.d*w/o r-d". So, my question is: How can I modify my conditional statement so that if a user enters the string "badword" with ANY non-alphanumeric characters in between each letter, then the program quits? Thank you so much.
Back to
Seekers of Perl Wisdom
|
|