[ 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...

-- 
  Ain't there one damn song
  That can make me break down and cry

Attachment: pgpzrcvCCqE1n.pgp
Description: PGP signature

Reply via email to