A
Alan J. Flavell
Alan J. Flavell said:[...] I
find it well-tuned to producing the kind of HTML that's needed in and
around forms submission - which, after all, is what it's aiming at.
It would tend to break the separation-of-presentation principle,
though
I don't really see that, I'm afraid. If I'm generating structural
HTML with CGI.pm, I can apply a separate external stylesheet without
any kind of co-operation (nor interference, for that matter) from
CGI.pm.
(you'd have to refer back to your code to check if/where styles are
being applied on the input fields, for example).
If a style is being applied to unique elements of a specific form,
then I'd still prefer to simply name or id the element(s) in
question, and apply the style from a separated stylesheet, as a matter
of best practice. That way, re-styling is much simpler, without
needing any interference with the generated HTML.
(Of course that are also Q&D instances where I'd shove the styles
in-line, but my Q&D hacks are not really fit to be discussed in detail
here.)
I'm not saying that you're wrong; just that there are personal
preferences involved, and if the results fit the requirements then it
could just be a matter of personal preference how we get there. I
will of course concede that sometimes one starts on what seems to be a
simple problem using simple techniques, and later realises that one
has painted oneself into a corner, when a more-general approach may
have involved more work at the start, but produces a system that's
more easily extended and evolved. In that sense I accept that a well
thought out templating system rates to beat a solution which shovels
code and data into a single edifice.
(I mean to take some time to look at Gunnar's example before
commenting on that subthread. Apologies.)
all the best.