Quoting Kee, Katherine J <[EMAIL PROTECTED]> [14 Feb-02 13:55]:
>       I finally understand why I why I was getting inconsistent
>       results.  I misunderstood what .sort was trying to
>       accomplish.  I am trying to sort on the Hash keys, not the
>       Hash values and it doesn't appear there is that functionality
>       currently in the system.  To add that functionality I went
>       into Stash.pm and added a line at line 94:
> 
>     'sortkeys'   => sub { [ sort keys %{ $_[0] } ] },
> 
> and now am able to sort my hashes based on keys.   

You can add this virtual method to your script, and not have to
pollute your copy of Template::Stash, like so:

  $Template::Stash::HASH_OPS->{'sortkey'} = sub { [ sort keys %{ $_[0] } ] };

That way, you won't lose it when you upgrade.

(darren)

-- 
To ensure privacy and data integrity this message has been
encrypted using dual rounds of ROT-13 encryption.


Reply via email to