in reply to printing a string from an sql field that contains a variable

The usual approach to achieve what you want is to use a template, for example Text::Template.

If you in advance which variables will interpolate into which string and in which order, you can also abuse sprintf format strings as templates.

  • Comment on Re: printing a string from an sql field that contains a variable