Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^4: HTML::Template, pseudo trees and indention.

by maverick (Curate)
on Jan 10, 2006 at 16:03 UTC ( #522220=note: print w/ replies, xml ) Need Help??


in reply to Re^3: HTML::Template, pseudo trees and indention.
in thread HTML::Template, pseudo trees and indention.

/me reads question again.

...only for strict definitions of "twist". He already has the tree as an array. He already has the depth of the nodes in the tree. The only thing he's missing is the not-so-magical trick of having H::T produce html to create the changes in depth. For that you need to know how much and which way the depth changes between any two nodes and then use a tmpl_loop to generate the right number of opens / closes.

Granted the code needs comments, but impossible to follow is a stretch. jeffa figured it out sans comments in the time it took me to type this respone...can't be that bad :)

/\/\averick


Comment on Re^4: HTML::Template, pseudo trees and indention.
Re^5: HTML::Template, pseudo trees and indention.
by dragonchild (Archbishop) on Jan 10, 2006 at 16:47 UTC
    jeffa understanding something and your average programmer understanding it are two completely different things. You see, jeffa actually has (at least) half a brain and is willing to use it. :-)

    I might have been a little harsh in my response. But, I feel that BUU's tree representation, while compact, is mostly unusable. Given a more useful tree representation (such as Tree or Tree::Simple), one is inevitably led to use one of the tools that already exist for reformatting objects of those classes (which I list in my original response). Why reinvent the wheel?


    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
      hehehee. why? simple. You said it "couldn't be done, period".

      Naturally, we can debate the merits of near a infinite number of possible solutions (TIMTOWTDI after all), but that wasn't the point :)

      /\/\averick

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2014-07-11 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (224 votes), past polls