in reply to Digging interpolation deeper

You might want to consider using a package like HTML::Template. It allows you to place tags and loops into a file for interpolation on the fly. And it's quite safer than eval :).

For example:

template.txt

This is the time: <!-- TMPL_VAR NAME="TIME" -->

Source:

use HTML::Template; my $tmpl=HTML::Template->new(filename => 'template.txt'); $tmpl->param( TIME => scalar localtime(time) ); print $tmpl->output;
And, in case you didn't realize, it doesn't actually require the source to be HTML as it removes it's own "TMPL_VAR" tags from the template when displaying.