Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Properly indented using HTML::Tiny

by herveus (Parson)
on Oct 20, 2009 at 11:59 UTC ( #802201=note: print w/replies, xml ) Need Help??

in reply to Properly indented using HTML::Tiny


What do *you* mean when you say "properly indented"? The output you present appears to have line breaks in appropriate places, but even those are not a formal requirement.

You allude to an example in the POD; it would be helpful if you had included it to show us what you were expecting.

Perhaps the lack of indentation is part and parcel of being "simple and lightweight".


Replies are listed 'Best First'.
Re^2: Properly indented using HTML::Tiny
by SnowWolf75 (Initiate) on Oct 21, 2009 at 22:52 UTC
    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 ( ) 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)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://802201]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2021-10-22 04:48 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (85 votes). Check out past polls.