The
CGI::Ex::App framework which I use allows you to either return a file name or a reference to a scalar containing the template. It then passes the value along to
CGI::Ex::Template which is Template Toolkit compatible and will process either a filename or a reference to a scalar.
This allows for easy prototyping in a single file, and then the capability to move items out to separate files later.
sub main_file_print { 'my_content/my_script/main.html' }
sub otherstep_file_print {
return \ qq{<html>
My template follows here.
</html>
};
}
my @a=qw(random brilliant braindead); print $a[rand(@a)];