Your date format is not suitable for sorting. It should be in YYYY/MM/DD format and not DD/MM/YYYY. From your code a date 10/10/2008 comes first compared to 09/09/2000. In addition, the sort function is not by default a numeric sort, which is what you want. If you try to sort the array (2,10) then you will get (10,2). You should reconsider also, the way you build up the hash: the => seems irrelevant in the outer hash.