... without template system ...
I "invented" my own pure Perl language templating ...
First off, templating without a system which leads to a templating solution re-inventing the wheel is not something which won't be frowned upon not too much here. That said, your templating just consists in interpolating function call returns into here-docs via the babycart operator @{[]} - which is - boiled down - all what templating is about.
In a node above, you write:
The whole app is still in conception, texts and design will change often, and the form of translation isn't sure yet.
...
Transition shouldn't be to complicated later.
Well, most likely later on your static here-docs will be split up and parametrized as well, you'll most likely get tag classes, iterations, conditional iterations, css and javascript and such - and complexity will grow.
It is much like parsing XML with regular expressions - by the time you will have resolved all those issues, you will have written the better part of a templating system. And I bet it will be close to any one already done (including my attempt).
If none of the above will ever happen - well, then: looks fine to me. Hashes, function calls - straight forward.
I feel like an Old Grey Monk, now.
In reply to Re: RFC: improvising multi language HTML
by shmem
in thread RFC: improvising multi language HTML
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |