in reply to Interpolation of variables read from a file

What you need is called a templating system. You could roll out your own, use an existing one such as the Template Toolkit.
  • Comment on Re: Interpolation of variables read from a file