my $doc = 'This /and/ that.'; $doc =~ s!/!\\!g; print $doc;