http://www.perlmonks.org?node_id=464103


in reply to Custom Module Work

Try adding local *tpl; 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.

Update:
Added the bit in parens.