in reply to Incredibly stupid substitution question :(

I'm going to assume escaping the dots is so that the string can be used inside a regex, in which case, quotemeta will be perfect.

print quotemeta('Kev.has.a.stupid.perl.question')."\n";

Produces:

Kev\.has\.a\.stupid\.perl\.question