sub by_date { my ($monA, $monB, $dayA, $dayB, $yearA, $yearB); ($monA, $dayA, $yearA) = split(/\//, $a->[1]); # <-- slight change ($monB, $dayB, $yearB) = split(/\//, $b->[1]); # <-- slight change $yearA <=> $yearB or $monA <=> $monB or $dayA <=> $dayB } @H = map { [ $_, $H{$_} ] } keys(%H); foreach $k (sort by_date @H)) { # $k->[0] is the key. # $k->[1] is the value. ... }