Most likely you can do this with the World's Simplest Templating Engine:
use File::Slurp 'read_file'; my $template = read_file($template_name); 1 while $template =~ s/\[%\s*INCLUDE\s(.*?)\s*%\]/read_file($1)/msge; print $template;
This will not handle include parameters and will not search different directories, but you can add that by replacing read_file by a subroutine more suited to your needs.
Update: Corrected regular expression according to pc88mxer's comment
In reply to Re: Template Toolkit "Pre-Processor"
by Corion
in thread Template Toolkit "Pre-Processor"
by hogsmill
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |