From: "Buddy Burden" <[EMAIL PROTECTED]>

> Josh,
>
> > This would not work since that usage of 'sort' is only for an array ref,
> > and the original ref was a hash ref.
>
> Ah, so it was.
>
> I wonder if Octavian could recast his collection to be an array rather
than a
> hash then (similar to your first suggestion).  It would depend, obviously,
on
> if he were ever referring to the elements by the "idN" tags or not.
>
> Elsewise, were it me, I'd go with a new vmethod (which I believe was your
3rd
> suggestion).
>

No, unfortunately I cannot create an array ref because the hash contains a
list of articles identified by an MD5 hash, and each article has a title, a
sub-title, a rank (number), a body, the number of visits per that article,
and the number of comments, and a few other variables.

And I want to sort by the number of visits in a case, then by the number of
comments in other case, then by the rank, and so on, and I might need to
sort the hash by more of these fields, so I guess I will follow the
suggested ways.

Thank you.

Teddy


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

Reply via email to