A renderer in this context is something that turns a data structure into a string. This includes templating engines, serialisers etc.
Any::Renderer is a Perl module that provides a consistent API to these services so that your application can generate output in an extensible variety of formats. Formats currently supported include:
- XML (via XML::Simple)
- The formats supported by Data::Serializer (e.g. Config::General and Config::Wrest)
- Any templating language supported by Any::Template
The module will discover any backend modules and offer up their formats. Once loaded, Any::Renderer will look for a module to handle any new formats it doesn't know about, so adding new formats in a persistent environment won't require the module to be reloaded. However if you CHANGE which module provides a format you will need to reload Any::Renderer (e.g. send a SIGHUP to modperl).
$renderer = new Any::Renderer ( $format, \%options );
$string = $renderer->render ( $structure );
$bool = Any::Renderer::requires_template ( $format );
$list_ref = Any::Renderer::available_formats ();