use Regexp::Common qw(RE_profanity); $message =~ s/$RE{profanity}/bleep/msg;