Hi,
Can someone tell me how to split a form field into individual words.
I have this so far...
$comments = $FORM{Comments};
split(/\s/,$comments);
So the split version of $comments is then in $_ isn't it? - So how do I get each individual word?
Basically I am trying to filter swear words - but I don't think this will work...
if ($_ eq "SWEARWORD") {
$_ =~ /SWEARWORD/*****/;
}
Would it be easier to use something like....
if ($comments =~ /\sWORD/i) {
# Strip the word.....
# But again that doesnt check very well - help pleeeeese
}
Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Can someone tell me how to split a form field into individual words.
I have this so far...
$comments = $FORM{Comments};
split(/\s/,$comments);
So the split version of $comments is then in $_ isn't it? - So how do I get each individual word?
Basically I am trying to filter swear words - but I don't think this will work...
if ($_ eq "SWEARWORD") {
$_ =~ /SWEARWORD/*****/;
}
Would it be easier to use something like....
if ($comments =~ /\sWORD/i) {
# Strip the word.....
# But again that doesnt check very well - help pleeeeese
}
Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/