in reply to Re: Word boundary '\B' - Question
in thread Word boundary '\B' - Question

Since he particularly mentions alphanumeric or underscore, I think \w would be more appropriate than \S. Which would be equivalent to: $str =~ s/\b~~~\b/~~~/g;