in reply to Templates on the cheap?

This is described in detail in How can I expand variables in text strings?. Go read.

-- Randal L. Schwartz, Perl hacker