Subject: | wish: support for non-file templates |
I'm working on CAP::BREAD, which currently has default templates embedded in the Perl files.
We would like to use ::AnyTemplate on the project, and it would be nice if it supported loaded templates from sources other than files.
I see that we can pass 'scalarref => $our_template' to HTML::Template, but I'm sure it will get confused when a file name to open is also passed.
One possible way to design for this is to check the 'file name' parameter that is passed in to see if is a scalarref. If so, assume it is the template. If the underlying template engine doesn't support this, you could either die (easy), or emulate the feature (harder).
Thanks!
Mark