Syntactic Confectionery Delight | |
PerlMonks |
Re: HTML::Template-2 on oneby dragonchild (Archbishop) |
on Nov 21, 2004 at 04:35 UTC ( [id://409322]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|