If by chance you are starting with DBI-accessed database and want to send the output to HTML::Template, then Data::Grouper may be just the tool you need.
I'm doing a lot less complex data structure transformation since I discovered that.
Wow, thanks markjugg. It makes me just how many CPAN modules I could use and am not. Yes, Data::Grouper looks awesome. I spent days getting triple nested <TMPL_LOOP>'s to work. I'll look into this.
—Brad "Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton