No, the split is in @_ not $_. You would have to loop through that array and look at each word.
What you could do is, keep an array of all the words you want to block, then a substituition could get it done.
Please note, this is a very quick example, and im sure that given a little thought there would be a better, more efficient solution, but this is just one way to do it, to get you started.
Note this will only work on exact matches, and not with words embedded within another word
$comments = 'This is a tame set of foo words. This comment sucks, but hey...blah.';
print "$comments\n";
$comments =~ s/\b$_\b/'*' x length $_/egi foreach @swears;
print "$comments\n";
Installation support is provided via ICQ at UIN# 53788453. I will only respond on that number.
What you could do is, keep an array of all the words you want to block, then a substituition could get it done.
Please note, this is a very quick example, and im sure that given a little thought there would be a better, more efficient solution, but this is just one way to do it, to get you started.
Note this will only work on exact matches, and not with words embedded within another word
Code:
@swears = qw(blah foo sucks); $comments = 'This is a tame set of foo words. This comment sucks, but hey...blah.';
print "$comments\n";
$comments =~ s/\b$_\b/'*' x length $_/egi foreach @swears;
print "$comments\n";
Installation support is provided via ICQ at UIN# 53788453. I will only respond on that number.