[Templates] hash key

Dave Howorth dhoworth@mrc-lmb.cam.ac.uk
Wed, 15 Feb 2006 10:12:08 +0000


Josh Rosenbaum wrote:
> Here's another method if Tim is just looking for a shorter way to do 
> things. (Sorted by the keys in hash (ie: 'box_1') which seems to be the 
> original intent.)
> 
> [% FOREACH key IN hash.keys.sort() %]

If all the keys in the hash are of the form box_n and if the OP wants to 
select all the entries in the hash, then an shorter solution would be to 
use an array instead of a hash!

Cheers, Dave