in reply to Sort hash keys
On the face of it all you need is a small adjustment to your sort function:
my %seq = ('1035-2341', '1', '1035-2347', '1', '1035-65', '1', '1035-4 +6', '1'); foreach (sort {length $a <=> length $b || $a cmp $b} keys %seq) { print $_, "\n"; }
Prints:
1035-46 1035-65 1035-2341 1035-2347
|
|---|