early within the parse method of template.pm. This might get you to second base, but you're still better off with a templating module (from CPAN). Although many boast about how easy it is to write a template parser, it isn't - particularly if you want one that is truely easy to use, extensible, flexible, and so on. I should know, I've (sadly) been reinventing the wheel for many years.