Dave Cross wrote:
[ reordering to make sense of the discussion ]
On Mon, Jun 20, 2005 at 02:08:20AM -0600, Josh Rosenbaum wrote:
Buddy Burden wrote:
Doesn't this
[% FOREACH r = ref.sort('number') %]
work?
This would not work since that usage of 'sort' is only for an array ref,
and the original ref was a hash ref.
Actually, the "sort" vmethod does work on hash refs as well as array refs.
It returns a list of hash keys that you can use to process the hash in the
sorted order.
The suggested code doesn't work because the original poster wanted to
sort by a value hidden two values deep in a hash of hashes.
Dave...
That's what I said. You'll notice the phrase "that usage of 'sort'" in my
previous post.
-- Josh
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates