Gossamer Forum
Home : General : Perl Programming :

I need to strip words from a varible.

Quote Reply
I need to strip words from a varible.
 I need to string a list of words from a varible. The varible is $val (form output)

How might I do this?

Thanks,
Vivitron
Quote Reply
Re: I need to strip words from a varible. In reply to
It would depend on what the words were, what was in the string, etc. You'll have to be more specific.

adam

[This message has been edited by dahamsta (edited May 28, 1999).]
Quote Reply
Re: I need to strip words from a varible. In reply to
I think this code will help you:

Code:
open (badwords, "badwords.txt")
@badwords=<badwords>;
close (badwords);
foreach $words (@badwords)
{
if ($val =~ "$words")
{
print "Bad word was found!";
}
else
{
print "No bad words found!";
}
}

Regards,

Pasha

------------------
webmaster@find.virtualave.net
http://find.virtualave.net