Hi

Sorry for the trouble...I got it....
we can use reverse function...


Once again Sorry....

Anish
  ----- Original Message ----- 
  From: Anish Kumar K 
  To: beginners@perl.org 
  Sent: Monday, September 12, 2005 11:20 AM
  Subject: Need help with sorting on perl template toolkit


  Hi

  I needed the help as how to sort descending in a hash

  [%FOREACH keyValue = wordCount.nsort(wordCount.$keyValue)%]

  <tr bgcolor=[%BGCOLOR%]>
     
     <td>[% keyValue %]</td>

     <td>[% wordCount.$keyValue %]</td>
      
    </tr>

  [%END%]

  This is sorting in ASCENFDING order. I tried out giving - , NOT ASC 
everything.nothing working. Please suggest as how to sort this..


  One more: I am processing the results from a  JAVA appllication. It could 
also help if you know any collection wich willl preserve the order, like
  From the DATABASE I am getting in descending order and storing in TreeMap and 
then while printing that the descending order is not maintained.
  So my way is either i need to sort in the JAVA side or PERL side. I tried 
many collections arraylist,MAp,HashMap...Nothign working....

  Thanks
  Anish

Reply via email to