I have a hash of ( id => name ) pairs, from which I want to create a CGI
checkbox group:

  CGI.checkbox_group('team', team.keys, 1, 1, team).join

However, I'd like to sort the output of hash.keys - but by the names of
the teams, not their IDs.

In perl this would be sort { $team{$a} cmp $team{$b} } keys %team, but I
can't work out how to do this sort of thing in TT. I'm guessing that
it's a common enough thing that there must be an idiom for it, but I'll
feeling particularly slow today ...

Thanks,

Tony


_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to