Please read the description of this forum. You'll notice it isn't for general perl questions.
This is the forum you want:
http://gossamer-threads.com/...gforum.cgi?forum=14;
You may as well continue here though and a staff member will move the post.
A primitive example is:
my $string = 'Paul went to see Bob but Bill and Ben fell off a cliff';
foreach my $noun (@nouns) {
$string =~ s/$noun/ /ig;
}
For your situation you'd probably want to open your file and use a while loop depending on the amount of nouns you are storing.
This is the forum you want:
http://gossamer-threads.com/...gforum.cgi?forum=14;
You may as well continue here though and a staff member will move the post.
A primitive example is:
Code:
my @nouns = qw/paul bob bill ben/; my $string = 'Paul went to see Bob but Bill and Ben fell off a cliff';
foreach my $noun (@nouns) {
$string =~ s/$noun/ /ig;
}
For your situation you'd probably want to open your file and use a while loop depending on the amount of nouns you are storing.