#!/usr/local/bin/perl -w use strict; my %h = ( key1 => "10/14/2003", key2 => "11/23/2001", key3 => "12/23/2001", key4 => "12/22/2001", key5 => "02/21/1984", key6 => "08/13/1969", key7 => "09/11/1973", key8 => "09/30/2000" ); my @bydate = map { my @tmp = split /\//, $h{$_}; pack 'A4A2A2A*', $tmp[2], $tmp[0], $tmp[1], $_; } keys(%h); foreach (sort @bydate) { print "@{[unpack ('A4A2A2A*',$_)]}\n"; }