in reply to Re: Properly indented using HTML::Tiny
in thread Properly indented using HTML::Tiny
When I started my foray into coding, I picked up from somewhere that tags should be indented with a tree-like structure for readability. The output of the code snippet I allude to ( http://search.cpan.org/dist/HTML-Tiny/lib/HTML/Tiny.pm ) shows such indenting - tags that enclose other tags create an indent while sibling tags are at the same indent level - which is where my confusion and/or frustration came from. To me, the phrasing in the POD said I would get that indenting.
The solution I found was to write my own functions - ti(), to(), and te() - to indent, 'out-dent', and 'equal-dent' the output by means of a global indent level variable. Putting these at the beginning of the line, or sometimes inside the HTML::Tiny autotags, created a nice flowing structure, at least to me. I know that there aren't hard standards for writing the HTML, but I prefer legibility over compactness more times. (likely why I've never gotten the hang of reading/writing obfuscated code)