in reply to Re^4: s/// not replacing data
in thread s/// not replacing data
The \Q is mostly precautionary, in case $badword might have a regex-special char in it.while ($sth->fetch) { $username =~ s/\b\Q$badword\b/ **** /gi or print "[$badword] not found in $username\n"; $message =~ s/\b\Q$badword\b/ **** /gi or print "[$badword] not found in $message\n"; }
|
|---|