in reply to separating replacements

G'day electic!mp,

Welcome to the Monastery.

"... how does one separate variables from real stuff in the replacement?"

Put braces around the name part of the variable. E.g.

$ perl -E 'say 2.3 =~ s/(\d\.)(\d)/${1}0$2/r' 2.03

— Ken