in reply to hiccoughing here documents

This is beginning to look like a use-case for Text::Template or Template::Simple.

I think that is a much better alternative compared to the ugly solutions (including my earlier one) proposed so far.

                All power corrupts, but we need electricity.