You could include some markup text in the string. When you come to render the HTML replace the markup text with the variable value. In its simplest version that could just entail using a regex.
But of course, what you are building is your own template system. When you need to go beyond a couple of trivial variable substitutions you'll realize you should have used a module in the first place. Being really lazy often entails a little more work up front.
Perl's payment curve coincides with its learning curve.