Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: HTML::Template-2 on one

by dragonchild (Archbishop)
on Nov 21, 2004 at 04:35 UTC ( [id://409322]=note: print w/replies, xml ) Need Help??


in reply to HTML::Template-2 on one

That's the beauty of using a templating system, like HTML::Template. You build your data structure within your script, then send it to the template. The template then goes ahead and displays the data any way it feels like.

The trick I think you're missing is that the data structure you're building isn't tied to where you get the data. Let's look at an example.

You have 5 resources. You want to display one row for each resource. The first column is the status and the second column is the last request. You will need to build an array of hashes to display everything within that TMPL_LOOP for the table. You pull your data in from each table into their own hashes. Then, you go ahead an build ANOTHER data structure, blending the two hashes from the different tables into the correct format.

You got the extract and you got the display. You were just missing the middle piece - transformation.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found