Perl templating system, generates and compiles code and allows for function hooks