Keep It Simple, Stupid | |
PerlMonks |
Data structure transformationby ar0n (Priest) |
on Apr 07, 2001 at 19:47 UTC ( [id://70722]=perlquestion: print w/replies, xml ) | Need Help?? |
ar0n has asked for the wisdom of the Perl Monks concerning the following question:
I'm working on a student registration application for my school, which uses HTML::Template. It grabs data from a database and needs to transform that data into a data structure that HTML::Template can use.
Each row looks like this:
The structure my template needs looks like this: Now, to get to the point; I'm using the following to get what I want: And it works, but.... it just rubs me the wrong way (take that Christina Aguilera!). It's icky. I don't like that temporary hash very much. Is there a more efficient/prettier way of getting what I want? I'm not really aiming for high-performance, since the query I'm using will never return over a 1000 records, but I'm curious... Thanks. [ar0n]
Back to
Seekers of Perl Wisdom
|
|