Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Sort a hash of hashes by value in template toolkitby jbert (Priest) |
on Nov 16, 2007 at 12:34 UTC ( [id://651180]=note: print w/replies, xml ) | Need Help?? |
This is why I don't like additional "little languages" like template toolkit. We have a good language with if's and loops in it to hand - perl. (I'm a fan of the Text::Template approach.).
There's probably a way of doing what you want in TT, but I'd personally avoid doing that and do the sort in perl. So you could populate an array with the data sorted in the order you need, then use a simpler piece of TT to do the output. In general, I'd advise keeping the TT as simple as possible and doing as much as possible in perl.
In Section
Seekers of Perl Wisdom
|
|