in reply to Re^3: s/// not replacing data
in thread s/// not replacing data
Does print out the swearword each time through the loop. I added the test print which I used originally. It's getting the data from the bind'd column.####### # connecting to the DB again so we can filter swear words ####### my $data = qq(SELECT id, word FROM swears); my $sth = $dbh->prepare($data); $sth->execute() or die $dbh->errstr; my ($id, $badword); $sth->bind_columns(\$id, \$badword); foreach my $line (reverse @keep) { my ($username, $message, $date, $ip) = split(/<!!>/, $line); #print "user: $username<br> message: $message<br> date: $date +<br> ip: $ip<br><br>"; while ($sth->fetch) { $username =~ s/\b$badword\b/ **** /gi; $message =~ s/\b$badword\b/ **** /gi; print "the badword was: $badword<br>"; } print "message: $message<br>"; push(@keep_after_swear_words, "$username<!!>$message<!!>$date<!! +>$ip"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: s/// not replacing data
by Roy Johnson (Monsignor) on Oct 31, 2005 at 17:05 UTC |