A very useful module for HTML and XML generation, especially after 1.03 was patched to produce validating HTML. Being able to provide a DOM fragment as a nested array is particularly useful. I'm currently using HTML::Tiny at $work to both generate the HTML of a web application and provide the DOM snippets as JSON data structures to the AJAX component. Since I encoded the snippets as nested arrays, I can simply call stringify() and json_encode() with the same data structure (bar converting scalar references to scalars strings for the latter first). Even better, the module has no non-core dependencies, so bundling or distributing it will not be a problem.
The convention of  (reference to the empty array) being interpreted as "generate the attribute, but don't set any value" is also useful. I can never remember how to do the same with CGI.pm.
My only gripe is that the utility methods -- such as json_encode() or url_encode() -- are not accessible as class methods, but you always have to construct a new object to use them.
4 out of 4 found this review helpful. Was this review helpful to you? Yes No
This module is a good attempt at a super-light HTML library and fulfils all the basic rules of ::Tiny.
My only negative is that by the extreme standards of the ::Tiny modules it is a bit bloated with accessor method overhead, when most of the options probably only need to be set once at constructor time and should just be provided there.
But otherwise, a competent effort.
2 out of 3 found this review helpful. Was this review helpful to you? Yes No
Thanks Adam. I screwed up.
I've just released 0.9 which removes all non-core dependencies and builds and tests cleanly against a number of Perls back as far as 5.0.4.
Accessor bloat gone now too.
0 out of 1 found this review helpful. Was this review helpful to you? Yes No